[devel] Removed the new alternate floor() and modf().
This commit is contained in:
parent
0fb715a904
commit
f3d53796af
15
png.c
15
png.c
@ -1155,21 +1155,10 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
|
||||
* that the final digit is rounded.
|
||||
*/
|
||||
if (cdigits+czero-clead+1 < (int)precision)
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
fp = modf(fp, &d);
|
||||
#else
|
||||
{
|
||||
d = (double)((int)(fp));
|
||||
fp -= d;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
d = floor(fp + .5);
|
||||
#else
|
||||
d = (double)((int)(fp + .5));
|
||||
#endif
|
||||
|
||||
if (d > 9)
|
||||
{
|
||||
@ -1353,11 +1342,7 @@ png_ascii_from_fp(png_structp png_ptr, png_charp ascii, png_size_t size,
|
||||
png_fixed_point
|
||||
png_fixed(png_structp png_ptr, double fp, png_const_charp text)
|
||||
{
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
double r = floor(100000 * fp + .5);
|
||||
#else
|
||||
double r = (double)((int)(100000 * fp + .5));
|
||||
#endif
|
||||
if (r <= 2147483647. && r >= -2147483648.)
|
||||
return (png_fixed_point)r;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user