octave-maintainers
[Top][All Lists]
Advanced

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

Re: 3.0.1 release?


From: John W. Eaton
Subject: Re: 3.0.1 release?
Date: Tue, 08 Apr 2008 19:51:14 -0400

On  8-Apr-2008, Michael Goffioul wrote:

| return x > 0 ? floor (x + 0.5) : ceil (x - 0.5);
| 
| This effectively adds 1 when x is equal to bitmax.
| 
| At this point, I don't now what to do.

I suppose we could write something like

  double ip;
  return modf (x, &ip) == 0.0 ? x : (x > 0 ? floor (x + 0.5) : ceil (x - 0.5));

Is there a better (and still portable) way to determine whether a
double value is an integer?

jwe


reply via email to

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