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

Robert C. Seacord via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 9 02:10: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
----------------
rcseacord wrote:

n3149 which passed the C23 DIS ballot states  that `rint `functions may raise the "inexact" floating-point exception

**7.12.9.4 The rint functions**
**Synopsis**
1 
```
#include <math.h>
double rint(double x);
float rintf(float x);
long double rintl(long double x);
#ifdef __STDC_IEC_60559_DFP__
_Decimal32 rintd32(_Decimal32 x);
_Decimal64 rintd64(_Decimal64 x);
_Decimal128 rintd128(_Decimal128 x);
#endif
```

**Description**
2 The rint functions differ from the nearbyint functions (7.12.9.3) only in that the rint functions
may raise the "inexact" floating-point exception if the result differs in value from the argument.

**Returns**
3 The rint functions return the rounded integer value.

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


More information about the llvm-commits mailing list