mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
- Fixed a rounding bug within the translation from float values to printable wstrings.
svn path=/trunk/; revision=4577
This commit is contained in:
parent
80b2784520
commit
9282a443a1
1 changed files with 7 additions and 5 deletions
|
@ -313,10 +313,11 @@ static int numberf(FILE * f, double __n, wchar_t exp_sign, int size, int precis
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while ( intr > 0.0 ) {
|
while ( intr > 0.0 ) {
|
||||||
intr/=10.0L;
|
p = intr;
|
||||||
p = modf(intr, &intr);
|
intr/=10.0L;
|
||||||
|
modf(intr, &intr);
|
||||||
|
|
||||||
p *=10;
|
p -= 10.0*intr;
|
||||||
|
|
||||||
buf[i++] = (int)p + L'0';
|
buf[i++] = (int)p + L'0';
|
||||||
size--;
|
size--;
|
||||||
|
@ -515,10 +516,11 @@ static int numberfl(FILE * f, long double __n, wchar_t exp_sign, int size, int
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
while ( intr > 0.0 ) {
|
while ( intr > 0.0 ) {
|
||||||
|
p = intr;
|
||||||
intr/=10.0L;
|
intr/=10.0L;
|
||||||
p = modfl(intr, &intr);
|
modfl(intr, &intr);
|
||||||
|
|
||||||
p *=10;
|
p -=10.0*intr;
|
||||||
|
|
||||||
buf[i++] = (int)p + L'0';
|
buf[i++] = (int)p + L'0';
|
||||||
size--;
|
size--;
|
||||||
|
|
Loading…
Reference in a new issue