This website works better with JavaScript.
Home
Help
Sign In
lolengine
/
lol
mirror of
https://github.com/lolengine/lol
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
0
Wiki
Activity
Browse Source
math: fix an infinite loop in the real number print function.
legacy
Sam Hocevar
sam
13 years ago
parent
dfdff977c1
commit
a949a2cd08
1 changed files
with
6 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+6
-0
src/real.cpp
+ 6
- 0
src/real.cpp
View File
@@ -1274,6 +1274,12 @@ void real::print(int ndigits) const
x = -x;
}
if (!x)
{
printf("0.0\n");
return;
}
/* Normalise x so that mantissa is in [1..9.999] */
/* FIXME: better use int64_t when the cast is implemented */
int exponent = ceil(log10(x));
Write
Preview
Loading…
Cancel
Save