mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
- Fixed a rounding bug within the translation from float values to printable strings.
svn path=/trunk/; revision=4570
This commit is contained in:
parent
33b0769d71
commit
0d54f93d31
1 changed files with 6 additions and 4 deletions
|
@ -307,10 +307,11 @@ static int numberf(FILE * f, double __n, char exp_sign, int size, int precision
|
|||
}
|
||||
else {
|
||||
while ( intr > 0.0 ) {
|
||||
p = intr;
|
||||
intr/=10.0L;
|
||||
p = modf(intr, &intr);
|
||||
modf(intr, &intr);
|
||||
|
||||
p *=10;
|
||||
p -= 10.0*intr;
|
||||
|
||||
buf[i++] = (int)p + '0';
|
||||
size--;
|
||||
|
@ -510,10 +511,11 @@ static int numberfl(FILE * f, long double __n, char exp_sign, int size, int pre
|
|||
}
|
||||
else {
|
||||
while ( intr > 0.0 ) {
|
||||
p=intr;
|
||||
intr/=10.0L;
|
||||
p = modfl(intr, &intr);
|
||||
modfl(intr, &intr);
|
||||
|
||||
p *=10;
|
||||
p -= 10.0L*intr;
|
||||
|
||||
buf[i++] = (int)p + '0';
|
||||
size--;
|
||||
|
|
Loading…
Reference in a new issue