From 80c280119b5abcf8a9be76a34172d3279ee49f17 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Sun, 17 Nov 2024 04:44:05 +0000 Subject: [PATCH 1/3] PHP 8.4: Document RoundingMode --- reference/math/roundingmode.xml | 109 ++++++++++++++++++++++++++++++++ reference/math/versions.xml | 3 + 2 files changed, 112 insertions(+) create mode 100644 reference/math/roundingmode.xml diff --git a/reference/math/roundingmode.xml b/reference/math/roundingmode.xml new file mode 100644 index 000000000000..ec20fbc14c2d --- /dev/null +++ b/reference/math/roundingmode.xml @@ -0,0 +1,109 @@ + + + The RoundingMode Enum + RoundingMode + + +
+ &reftitle.intro; + + The RoundingMode is used to specify how rounding + should be performed for round, + bcround, and BCMath::round. + +
+ +
+ &reftitle.enumsynopsis; + + + RoundingMode + + + HalfAwayFromZero + + Round to the nearest integer. + If the decimal part is 5, + round to the integer with the larger absolute value. + + + + + HalfTowardsZero + + Round to the nearest integer. + If the decimal part is 5, + round to the integer with the smaller absolute value. + + + + + HalfEven + + Round to the nearest integer. + If the decimal part is 5, + round to the even integer. + + + + + HalfOdd + + Round to the nearest integer. + If the decimal part is 5, + round to the odd integer. + + + + + TowardsZero + + Round to the nearest integer with a smaller or equal absolute value. + + + + + AwayFromZero + + Round to the nearest integer with a greater or equal absolute value. + + + + + NegativeInfinity + + Round to the largest integer that is smaller or equal. + + + + + PositiveInfinity + + Round to the smallest integer that is greater or equal. + + + + +
+
+
+ diff --git a/reference/math/versions.xml b/reference/math/versions.xml index f3688e13677d..f76a9e03e16e 100644 --- a/reference/math/versions.xml +++ b/reference/math/versions.xml @@ -48,6 +48,9 @@ + + + - Mathematical Functions @@ -37,10 +36,10 @@ &reference.math.constants; + &reference.math.roundingmode; &reference.math.reference; -