fixed t1_tofixed() to handle floats of the form .001 and -.001 correctly.
This commit is contained in:
parent
07373c8de9
commit
dd81f42282
|
@ -504,17 +504,22 @@
|
||||||
if ( cur >= limit )
|
if ( cur >= limit )
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* first of all, read the integer part */
|
/* first of all, check the sign */
|
||||||
result = t1_toint( &cur, limit ) << 16;
|
if ( *cur == '-' )
|
||||||
num = 0;
|
|
||||||
divider = 1;
|
|
||||||
|
|
||||||
if ( result < 0 )
|
|
||||||
{
|
{
|
||||||
sign = 1;
|
sign = 1;
|
||||||
result = -result;
|
cur++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* then, read the integer part, if any */
|
||||||
|
if ( *cur != '.' )
|
||||||
|
result = t1_toint( &cur, limit ) << 16;
|
||||||
|
else
|
||||||
|
result = 0;
|
||||||
|
|
||||||
|
num = 0;
|
||||||
|
divider = 1;
|
||||||
|
|
||||||
if ( cur >= limit )
|
if ( cur >= limit )
|
||||||
goto Exit;
|
goto Exit;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue