pspp-dev
[Top][All Lists]
Advanced

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

Re: trunc


From: Ben Pfaff
Subject: Re: trunc
Date: Mon, 27 Nov 2006 19:51:47 -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.

I've now started a discussion about a gnulib module over in the
gnulib list.  I'll probably try to contribute one.
-- 
"Welcome to the Slippery Slope. Here is your handbasket.
 Say, can you work 70 hours this week?"
--Ron Mansolino




reply via email to

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