Skip to content

Commit 8337ad1

Browse files
authored
Merge pull request #1054 from JohnTitor/mention-inf-on-float-int-casting
Mention (negative) infinity values on float-to-int casting
2 parents 7ab0256 + 41aa8f9 commit 8337ad1

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/expressions/operator-expr.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -349,10 +349,8 @@ reference types and `mut` or `const` in pointer types.
349349
* sign-extend if the source is signed
350350
* Casting from a float to an integer will round the float towards zero
351351
* `NaN` will return `0`
352-
* Values larger than the maximum integer value will saturate to the
353-
maximum value of the integer type.
354-
* Values smaller than the minimum integer value will saturate to the
355-
minimum value of the integer type.
352+
* Values larger than the maximum integer value, including `INFINITY`, will saturate to the maximum value of the integer type.
353+
* Values smaller than the minimum integer value, including `NEG_INFINITY`, will saturate to the minimum value of the integer type.
356354
* Casting from an integer to float will produce the closest possible float \*
357355
* if necessary, rounding is according to `roundTiesToEven` mode \*\*\*
358356
* on overflow, infinity (of the same sign as the input) is produced

0 commit comments

Comments
 (0)