[Top][All Lists]

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

Re: trunc

From: Ben Pfaff
Subject: Re: trunc
Date: Sun, 26 Nov 2006 17:14:44 -0800
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

John Darrington <address@hidden> writes:

> On Sat, Nov 25, 2006 at 06:58:41PM -0800, Ben Pfaff wrote:
>      I'd suggest checking for trunc with Autoconf, then providing an
>      implementation based on floor if it doesn't exist, i.e. something
>      like this:
>      #ifndef HAVE_TRUNC
>      double
>      trunc (double d)
>      {
>        return d >= 0.0 ? floor (d) : -floor (-d);
>      }
>      #endif
>      I do something like this for the "round" function.
> That's a good idea.  Maybe we should gather these sort of functions
> into a common module and put it in libpspp and/or offer it to the
> gnulib developers for inclusion there.

Sure, that's a good idea if anyone wants to take the time.
Ben Pfaff 
email: address@hidden

reply via email to

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