Skip to content

Commit

Permalink
Fix return type precision for n_thermal (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
ytdHuang authored Oct 4, 2024
2 parents 036c765 + 6972ee5 commit bde9142
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utilities.jl
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ n(\omega, \omega_{\textrm{th}}) = \frac{1}{e^{\omega/\omega_{\textrm{th}}} - 1},
```
where ``\hbar`` is the reduced Planck constant, and ``k_B`` is the Boltzmann constant.
"""
function n_thermal::Real, ω_th::Real)::Float64
function n_thermal::T1, ω_th::T2) where {T1<:Real,T2<:Real}
x = exp/ ω_th)
n = ((x != 1) && (ω_th > 0)) ? (1.0 / (x - 1.0)) : 0.0
return n
n = ((x != 1) && (ω_th > 0)) ? 1 / (x - 1) : 0
return _FType(promote_type(T1, T2))(n)
end

_get_dense_similar(A::AbstractArray, args...) = similar(A, args...)
Expand Down

0 comments on commit bde9142

Please sign in to comment.