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: Sun, 26 Nov 2006 20:41:26 -0800
User-agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.4 (gnu/linux)

Ben Pfaff <address@hidden> writes:

> C99 added some useful functions to math.h, such as trunc and
> round.  Would there be objections to a module that adds
> implementations of those functions?  I am particularly interested
> in those two functions, which are handy for GNU PSPP, and so I am
> likely to write such a module if acceptance would be likely.

Sounds good to me; thanks.

I assume you know about doing the right thing with infinities and NaNs
and with signed zeros.

What implementation would you use?  'round' is trickier that it might
appear at first, due to problems with internal rounding.  Even 'trunc'
is a bit tricky, since trunc(-0.0) should yield -0.0, not 0.0.




reply via email to

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