3.0.1 release?

John W. Eaton jwe at bevo.che.wisc.edu
Tue Apr 8 18:51:14 CDT 2008


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


More information about the Octave-maintainers mailing list