Skip to content

Commit 0251728

Browse files
committed
LangRef: rint, nearbyint: mention that default rounding mode is assumed
1 parent d084829 commit 0251728

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm/docs/LangRef.rst

+10-2
Original file line numberDiff line numberDiff line change
@@ -15751,7 +15751,11 @@ Semantics:
1575115751
""""""""""
1575215752

1575315753
This function returns the same values as the libm ``rint`` functions
15754-
would, and handles error conditions in the same way.
15754+
would, and handles error conditions in the same way. Since LLVM assumes the
15755+
:ref:`default floating-point environment <floatenv>`, the rounding mode is
15756+
assumed to be set to "nearest", so halfway cases are rounded to the even
15757+
integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>`
15758+
to avoid that assumption.
1575515759

1575615760
.. _int_nearbyint:
1575715761

@@ -15789,7 +15793,11 @@ Semantics:
1578915793
""""""""""
1579015794

1579115795
This function returns the same values as the libm ``nearbyint``
15792-
functions would, and handles error conditions in the same way.
15796+
functions would, and handles error conditions in the same way. Since LLVM
15797+
assumes the :ref:`default floating-point environment <floatenv>`, the rounding
15798+
mode is assumed to be set to "nearest", so halfway cases are rounded to the even
15799+
integer. Use :ref:`Constrained Floating-Point Intrinsics <constrainedfp>` to
15800+
avoid that assumption.
1579315801

1579415802
.. _int_round:
1579515803

0 commit comments

Comments
 (0)