From 2b948b3051f5e4fec8216b0364bb597a664fb24d Mon Sep 17 00:00:00 2001 From: Philippe Delente Date: Thu, 6 Feb 2025 20:29:10 +0100 Subject: [PATCH] update reference math round doc en --- reference/math/functions/round.xml | 68 ++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 3 deletions(-) diff --git a/reference/math/functions/round.xml b/reference/math/functions/round.xml index 89786f83a1..f812a504c7 100644 --- a/reference/math/functions/round.xml +++ b/reference/math/functions/round.xml @@ -1,6 +1,6 @@ - + @@ -13,7 +13,7 @@ floatround intfloatnum intprecision0 - intmodePHP_ROUND_HALF_UP + intRoundingModemodeRoundingMode::HalfAwayFromZero Retourne la valeur arrondie de num @@ -78,7 +78,7 @@ mode - Utilisez une des constantes suivantes pour spécifier le mode d'arrondi. + Utilisez RoundingMode ou l'une des constantes suivantes pour spécifier la méthode d'arrondi. @@ -119,6 +119,7 @@ + Toutefois, noter que certains modes nouvellement ajoutés n'existent que dans RoundingMode. @@ -152,6 +153,12 @@ + + 8.4.0 + + Quatre nouveaux modes d'arrondi ont été ajoutés. + + 8.4.0 @@ -328,6 +335,61 @@ float(-1.5) ]]> + + Exemple d'utilisation de <enumname>RoundingMode</enumname> + + %+.17g\n", $mode->name, $number, round($number, 0, $mode)); + } + echo "\n"; +} +?> +]]> + + &example.outputs; + + +9 +HalfAwayFromZero : +9.5 -> +10 +HalfAwayFromZero : -3.5 -> -4 + +HalfTowardsZero : +8.5 -> +8 +HalfTowardsZero : +9.5 -> +9 +HalfTowardsZero : -3.5 -> -3 + +HalfEven : +8.5 -> +8 +HalfEven : +9.5 -> +10 +HalfEven : -3.5 -> -4 + +HalfOdd : +8.5 -> +9 +HalfOdd : +9.5 -> +9 +HalfOdd : -3.5 -> -3 + +TowardsZero : +8.5 -> +8 +TowardsZero : +9.5 -> +9 +TowardsZero : -3.5 -> -3 + +AwayFromZero : +8.5 -> +9 +AwayFromZero : +9.5 -> +10 +AwayFromZero : -3.5 -> -4 + +NegativeInfinity : +8.5 -> +8 +NegativeInfinity : +9.5 -> +9 +NegativeInfinity : -3.5 -> -4 + +PositiveInfinity : +8.5 -> +9 +PositiveInfinity : +9.5 -> +10 +PositiveInfinity : -3.5 -> -3 +]]> + +