Skip to content
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

Force fractional exponent arguments to be 0 minimum #896

Open
AlexisRenchon opened this issue Oct 29, 2024 · 0 comments
Open

Force fractional exponent arguments to be 0 minimum #896

AlexisRenchon opened this issue Oct 29, 2024 · 0 comments

Comments

@AlexisRenchon
Copy link
Member

Fractional exponent will error if the argument is negative.
In ClimaLand.jl, we have such fractional exponent in src/standalone/Soil/Biogeochemistry/co2_parameterizations.jl for example. We should add a warning if the argument is negative (it should not happen).

See closed PR #841

We may need to discuss more what is the best approach, and where this is happening.

below is the error returned by Julia:

julia> (-1)^0.5
ERROR: DomainError with -1.0:
Exponentiation yielding a complex result requires a complex argument.
Replace x^y with (x+0im)^y, Complex(x)^y, or similar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant