On Jul 21, 2023, at 12:38, Marco Pivetta <ocram...@gmail.com> wrote: > Hey Jorg, > > What is the reason for using this over these? > > * https://www.php.net/manual/en/function.ceil.php > * https://www.php.net/manual/en/function.floor.php
floor() and ceil() don't have a $precision parameter. What could be even more useful, however, would be to add modes which always round towards / away from zero. I suspect the commenter intending to use these modes in accounting would prefer these semantics over an implementation (like theirs) which always rounds to numerically higher / lower values. It might also be appropriate to use more specific terminology for these modes, e.g. PHP_ROUND_FLOOR/_CEIL and PHP_ROUND_TO_ZERO/_AWAY_FROM_ZERO, rather than the ambiguous PHP_ROUND_DOWN. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: https://www.php.net/unsub.php