s than, as in strictly less?
Why? Do you mean <= ?
My statement is true for both < and <=, but I guess it would have been
less confusing if I had written "less then or equal to".
> If so, shouldn't lrint(INT_MAX) == INT_MAX = lround(INT_MAX)?
If the double type provide
; >
> > > 2147483647.00 is -1
> > > 2147483647.00 is -1
> > >
> > > That doesn't seem right: isn't INT_MAX representable as a long,
> > > even on these machines where sizeof(int) == sizeof(long)?
> >
> > If it is less than LONG_MAX,
> > l = lround(d);
> > printf("%f is %ld\n", d, l);
> >
> > return 0;
> > }
> >
> > 2147483647.00 is -1
> > 2147483647.00 is -1
> >
> > That doesn't seem right: isn't INT_MAX representable as a long,
> > e
these machines where sizeof(int) == sizeof(long)?
If it is less than LONG_MAX, then yes.
If so, shouldn't lrint(INT_MAX) == INT_MAX = lround(INT_MAX)?
If the double type provides enough mantisse (which I think it does on all
platforms), and if I read a few C standards correctly, then yes.
g)?
If so, shouldn't lrint(INT_MAX) == INT_MAX = lround(INT_MAX)?
On i386 (an ALIX), I see
2147483647.00 is 2147483647
2147483647.00 is -1
so lrint() returns the expected value but lround() does not.
On the amd64s I have, I see the expected:
2147483647.00 is 2147483647
2147483647.
5 matches
Mail list logo