Skip to content

Commit a2b6b19

Browse files
committed
Fix benchmark print_number infinite loop.
1 parent 8b7680a commit a2b6b19

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/bench.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void print_number(double x) {
2323
if (y < 0.0) {
2424
y = -y;
2525
}
26-
while (y < 100.0) {
26+
while (y > 0 && y < 100.0) {
2727
y *= 10.0;
2828
c++;
2929
}

0 commit comments

Comments
 (0)