From 41aa8f948140fad27f0d3e29d1b77f46a4aedff5 Mon Sep 17 00:00:00 2001 From: Yuki Okushi Date: Sun, 4 Jul 2021 15:00:23 +0900 Subject: [PATCH] Mention (negative) infinity values on float-to-int casting --- src/expressions/operator-expr.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 77d042fbb..cf040791c 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -349,10 +349,8 @@ reference types and `mut` or `const` in pointer types. * sign-extend if the source is signed * Casting from a float to an integer will round the float towards zero * `NaN` will return `0` - * Values larger than the maximum integer value will saturate to the - maximum value of the integer type. - * Values smaller than the minimum integer value will saturate to the - minimum value of the integer type. + * Values larger than the maximum integer value, including `INFINITY`, will saturate to the maximum value of the integer type. + * Values smaller than the minimum integer value, including `NEG_INFINITY`, will saturate to the minimum value of the integer type. * Casting from an integer to float will produce the closest possible float \* * if necessary, rounding is according to `roundTiesToEven` mode \*\*\* * on overflow, infinity (of the same sign as the input) is produced