Skip to content

Commit 193a1a5

Browse files
committed
Added test cases
1 parent f8b48e1 commit 193a1a5

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

ext/bcmath/tests/bcsqrt.phpt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ foreach ($scales as $scale) {
2828
}
2929
}
3030

31+
echo "\n";
32+
33+
$radicants = [
34+
"0.005432987654321",
35+
"0.0005432987654321",
36+
"0.0000000000005432987654321",
37+
"0.00000000000005432987654321",
38+
"0.00000000000098765432109876543210987654321098765432109876543210987654321",
39+
"0.000000000000098765432109876543210987654321098765432109876543210987654321",
40+
];
41+
foreach ($radicants as $radicant) {
42+
echo bcsqrt($radicant, 20), "\n";
43+
}
44+
3145
?>
3246
--EXPECT--
3347
0
@@ -52,3 +66,10 @@ foreach ($scales as $scale) {
5266
0.3872983346
5367
3.8729833462
5468
1.0000000000
69+
70+
0.07370880309922960619
71+
0.02330877013984435859
72+
0.00000073708803099229
73+
0.00000023308770139844
74+
0.00000099380799005580
75+
0.00000031426968054503

0 commit comments

Comments
 (0)