-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hard-coded Float64
values
#218
Comments
Thanks for the tip @glwagner! |
Not sure if nitpicking but would @inline redfield(::Union{Val{:P}, Val{:Z}, Val{:D}}, bgc::NPZD{FT}) where FT = FT(6.56) be better than @inline redfield(::Union{Val{:P}, Val{:Z}, Val{:D}}, bgc::NPZD{FT}) where FT = convert(FT, 6.56) to avoid extra layer(s) of method inference during compilation? |
Well, I thought they were the same! In Oceananigans source code we have been trying to migrate to |
That makes sense! For floats it's a super simple method inference. Maybe for more complex types there's more extra inference. But agree it's good to be more semantically obvious! |
I suspect there will be people cropping up (👀 @ali-ramadhan) want to use
Float32
. This will thwart them:OceanBioME.jl/src/Models/AdvectedPopulations/NPZD.jl
Line 320 in 3c287d6
All that's needed is
The key is to never write decimals in source code without
convert
.The text was updated successfully, but these errors were encountered: