-0.0f{32,64}.next_up()
should return the smallest non-zero positive value
#134224
Labels
A-floating-point
Area: Floating point numbers and arithmetic
C-discussion
Category: Discussion or questions that doesn't represent real issues.
I tried this code:
I expected to see this happen:
-0.0f32.next_up()
should return the smallest non-zero positivef32
value (f32::from_bits(0x1)
,1e-45
).-0.0f64.next_up()
should return the smallest non-zero positivef64
value (f64::from_bits(0x1)
,5e-324
).Instead, this happened:
-0.0f32.next_up()
returns-1e-45
.-0.0f64.next_up()
returns-5e-324
.Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: