mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
[devel] Guard "modf()" with PNG_FLOATING_ARITHMETIC_SUPPORTED.
This commit is contained in:
parent
6679d7c0b1
commit
b9109e8254
8
png.c
8
png.c
@ -1155,10 +1155,16 @@ 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
|
||||
{
|
||||
/* End of loop - round the whole number. */
|
||||
#ifdef PNG_FLOATING_ARITHMETIC_SUPPORTED
|
||||
d = floor(fp + .5);
|
||||
#else
|
||||
|
Loading…
x
Reference in New Issue
Block a user