Skip to content

Commit 9bd87c1

Browse files
authored
Merge pull request #65 from rkruppe/patch-1
Update description of float casts
2 parents f6ede52 + 9e800ad commit 9bd87c1

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/casts.md

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,11 @@ For numeric casts, there are quite a few cases to consider:
5656
value cannot be represented by the target integer type][float-int]**.
5757
This includes Inf and NaN. This is a bug and will be fixed.
5858
* casting from an integer to float will produce the floating point
59-
representation of the integer, rounded if necessary (rounding strategy
60-
unspecified)
59+
representation of the integer, rounded if necessary (rounding to
60+
nearest, ties to even)
6161
* casting from an f32 to an f64 is perfect and lossless
6262
* casting from an f64 to an f32 will produce the closest possible value
63-
(rounding strategy unspecified)
64-
* **[NOTE: currently this will cause Undefined Behavior if the value
65-
is finite but larger or smaller than the largest or smallest finite
66-
value representable by f32][float-float]**. This is a bug and will
67-
be fixed.
63+
(rounding to nearest, ties to even)
6864

6965

7066
[float-int]: https://github.com/rust-lang/rust/issues/10184
71-
[float-float]: https://github.com/rust-lang/rust/issues/15536

0 commit comments

Comments
 (0)