xref: /PHP-8.2/ext/standard/tests/math/bug24142.phpt (revision f8d79582)
1--TEST--
2Bug #24142 (round() problems)
3--FILE--
4<?php
5$v = 0.005;
6for ($i = 1; $i < 10; $i++) {
7    echo "round({$v}, 2) -> ".round($v, 2)."\n";
8    $v += 0.01;
9}
10?>
11--EXPECT--
12round(0.005, 2) -> 0.01
13round(0.015, 2) -> 0.02
14round(0.025, 2) -> 0.03
15round(0.035, 2) -> 0.04
16round(0.045, 2) -> 0.05
17round(0.055, 2) -> 0.06
18round(0.065, 2) -> 0.07
19round(0.075, 2) -> 0.08
20round(0.085, 2) -> 0.09
21