-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
powf for NaN returns 1 #60468
Comments
The contract for the
|
Interestingly, that does not correspond to any |
This could use additional documentation though, the docs for |
Copying the documentation for most functions from the POSIX standard would make sense for me, but that probably wants a separate issue specifically about that. |
It seems to comply with IEEE754 |
**Description:** `f64::powf` for `NaN` returns 1 instead of `NaN`, see rust-lang/rust#60468. We should handle that. **Related issue:** - Closes #9193 --------- Co-authored-by: magic-akari <[email protected]>
@qnighy your sample seems to be missing f64::NAN. |
The
powf
for floating point numbers seems to have optimization: when base is 1, always return 1. This optimization does not check if exponent is a number, soThis behavior is same for debug and release modes, f32 and f64. playground
The text was updated successfully, but these errors were encountered: