bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: module for missing math.h functions?


From: Paul Eggert
Subject: Re: module for missing math.h functions?
Date: Tue, 28 Nov 2006 00:33:49 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ben Pfaff <address@hidden> writes:

> The following actually makes an unconditional wrapper around
> <math.h>, in the same way as the fcntl module does.

Is that needed?  I'd think that the normal modern case wouldn't need
the wrapper.  It'd be nice to avoid the wrapper in that case, since
the wrapper is one more thing to go wrong.

> I used floorl and ceill from the mathl module to implement roundl
> and truncl.  I defined roundf and truncf to just call round and
> trunc, but another option would be to implement floorf and ceilf
> in the same way as roundl and truncl.

Please do it that other way; it can't hurt, and my instincts tell me
that we'll get double-rounding bugs if roundf just calls round.

> I haven't actually tested the function implementations.

But that's the most fun part!  :-)

One more thing.  I don't see why math_.h needs to include mathl.h.
Can't the '#include "mathl.h"' be moved to round.c and trunc.c?  It'd
save a bit on name space pollution.

Other that, it looks good so far; thanks.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]