3 ?RCS: Copyright (c) 2000 Jarkko Hietaniemi
5 ?RCS: You may distribute under the terms of either the GNU General Public
6 ?RCS: License or the Artistic License, as specified in the README file.
8 ?MAKE:d_modfl d_modfl_pow32_bug: Inlibc Compile cat rm sPRIfldbl d_longdbl \
9 osname gccversion ccflags run
10 ?MAKE: -pick add $@ %<
12 ?S: This variable conditionally defines the HAS_MODFL symbol, which
13 ?S: indicates to the C program that the modfl() routine is available.
16 ?S: This variable conditionally defines the HAS_MODFL_POW32_BUG symbol,
17 ?S: which indicates that modfl() is broken for long doubles >= pow(2, 32).
18 ?S: For example from 4294967303.150000 one would get 4294967302.000000
19 ?S: and 1.150000. The bug has been seen in certain versions of glibc,
20 ?S: release 2.2.2 is known to be okay.
23 ?C: This symbol, if defined, indicates that the modfl routine is
24 ?C: available to split a long double x into a fractional part f and
25 ?C: an integer part i such that |f| < 1.0 and (f + i) = x.
27 ?C:HAS_MODFL_POW32_BUG:
28 ?C: This symbol, if defined, indicates that the modfl routine is
29 ?C: broken for long doubles >= pow(2, 32).
30 ?C: For example from 4294967303.150000 one would get 4294967302.000000
31 ?C: and 1.150000. The bug has been seen in certain versions of glibc,
32 ?C: release 2.2.2 is known to be okay.
34 ?H:#$d_modfl HAS_MODFL /**/
35 ?H:#$d_modfl_pow32_bug HAS_MODFL_POW32_BUG /**/
39 ?LINT:set d_modfl_pow32_bug
45 d_modfl_pow32_bug="$undef"
47 case "$d_longdbl$d_modfl" in
50 Checking to see whether your modfl() is okay for large values...
56 long double nv = 4294967303.15;
62 printf(" %"$sPRIfldbl" %"$sPRIfldbl" %"$sPRIfldbl"\n", nv, v, w);
66 case "$osname:$gccversion" in
67 aix:) saveccflags="$ccflags"
68 ccflags="$ccflags -qlongdouble" ;; # to avoid core dump
71 if eval $compile; then
74 *" 4294967303.150000 1.150000 4294967302.000000")
75 echo >&4 "Your modfl() is broken for large values."
76 d_modfl_pow32_bug="$define"
78 glibc) echo >&4 "You should upgrade your glibc to at least 2.2.2 to get a fixed modfl()."
82 *" 4294967303.150000 0.150000 4294967303.000000")
83 echo >&4 "Your modfl() seems okay for large values."
85 *) echo >&4 "I don't understand your modfl() at all."
89 $rm -f try.* try core core.try.*
91 echo "I cannot figure out whether your modfl() is okay, assuming it isn't."
94 case "$osname:$gccversion" in
95 aix:) ccflags="$saveccflags" ;; # restore