Re: detection of isinf, isnan and other math functions

Stefan Kost <[email protected]>
Newsgroups gmane.comp.gnome.lib.xslt
Message-ID <[email protected]>
Am 25.05.2011 23:19, schrieb Roumen Petrov:
> Hello All,
> 
> I review recent changes done by  Stefan Kost into configure script I note that
> isinf and isnan are to detected properly.
> 
> Functions isinf and isnan are definitions not real functions, so correct macro
> has to be :
> AC_CHECK_DECLS([isinf, isnan], [], [], [[#include <math.h>]])
> 
> As ouher side I could not found where code use HAVE_ISNAN, HAVE_ISINF, HAVE_POW,
> HAVE_FLOOR and HAVE_FABS are used.
> May be good patch is to remove all those checks.
> 
> Regards,
> Roumen
> _______________________________________________

Hi Roumen,

I removed the checks for isinf and isnan as per commit
5425e22f366658c4de7342a202970330a02d3ba6.

As you said HAVE_POW, HAVE_FLOOR and HAVE_FABS are not used, but the functions
are. It would be quite bad if a math library would not have them. I need to
check what other projects are doing if those are missing.

Stefan

$ find . -name "*.c" -exec grep -Hn "fabs" {} \;
./libxslt/numbers.c:184:	if ((i >= width) && (fabs(number) < 1.0))
./libxslt/numbers.c:249:	if (fabs(number) < 1.0)
./libxslt/numbers.c:1260:    number = fabs(number) * (double)format_info.multiplier;
./libexslt/math.c:523:    ret = fabs(num);

$ find . -name "*.c" -exec grep -Hn "floor" {} \;
./libxslt/numbers.c:1262:    number = floor((scale * number + 0.5)) / scale;
./libxslt/numbers.c:1268:	xsltNumberFormatDecimal(buffer, floor(number),
self->zeroDigit[0],
./libxslt/numbers.c:1273:	xsltNumberFormatDecimal(buffer, floor(number),
self->zeroDigit[0],
./libxslt/numbers.c:1286:    if ((floor(number) == 0) &&
./libxslt/numbers.c:1298:      number -= floor(number);
./libxslt/numbers.c:1302:	    number = floor(scale * number + 0.5);
./libxslt/numbers.c:1308:	    xsltNumberFormatDecimal(buffer, floor(number),
self->zeroDigit[0],
./libexslt/date.c:1153:        double tmp = floor(secs / SECS_PER_DAY);
./libexslt/date.c:1442:#define FQUOTIENT(a,b)
((floor(((double)a/(double)b))))

$ find . -name "*.c" -exec grep -Hn "pow(" {} \;
./libxslt/numbers.c:1261:    scale = pow(10.0, (double)(format_info.frac_digits
+ format_info.frac_hash));
./libexslt/math.c:611:    ret = pow(base, power);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.