[llvm] LangRef: rint, nearbyint: mention that default rounding mode is assumed (PR #77191)

Joshua Cranmer via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 8 12:06:27 PST 2024


================
@@ -15751,7 +15751,9 @@ Semantics:
 """"""""""
 
 This function returns the same values as the libm ``rint`` functions
-would, and handles error conditions in the same way.
+would, and handles error conditions in the same way. The rounding mode
----------------
jcranmer-intel wrote:

`rint` corresponds to the IEEE 754 operation `roundToIntegralExact`, which signals inexact if the rounding isn't exact (i.e., most of the time). `nearbyint` corresponds to a theoretical operation `roundToIntegral` that never signals inexact, but this operation doesn't exist in IEEE 754 [1]; the variants that do exist all effectively use standard rounding modes.

[1] It was apparently a recommended operation in IEEE 854, but the committee appears to have explicitly voted to not make it a required operation. See https://speleotrove.com/decimal/854M8507.pdf for more details.

https://github.com/llvm/llvm-project/pull/77191


More information about the llvm-commits mailing list