Skip to content

Commit 6972ee5

Browse files
committed
fix return type precision for n_thermal
1 parent a3068b7 commit 6972ee5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/utilities.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ n(\omega, \omega_{\textrm{th}}) = \frac{1}{e^{\omega/\omega_{\textrm{th}}} - 1},
4242
```
4343
where ``\hbar`` is the reduced Planck constant, and ``k_B`` is the Boltzmann constant.
4444
"""
45-
function n_thermal::Real, ω_th::Real)::Float64
45+
function n_thermal::T1, ω_th::T2) where {T1<:Real,T2<:Real}
4646
x = exp/ ω_th)
47-
n = ((x != 1) && (ω_th > 0)) ? (1.0 / (x - 1.0)) : 0.0
48-
return n
47+
n = ((x != 1) && (ω_th > 0)) ? 1 / (x - 1) : 0
48+
return _FType(promote_type(T1, T2))(n)
4949
end
5050

5151
_get_dense_similar(A::AbstractArray, args...) = similar(A, args...)

0 commit comments

Comments
 (0)