[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-gsl] GSL_NEGZERO
From: |
Gerard Jungman |
Subject: |
Re: [Bug-gsl] GSL_NEGZERO |
Date: |
Thu, 14 Apr 2011 15:40:35 -0600 |
On Thu, 2011-04-14 at 13:44 +0100, Brian Gough wrote:
>
> Hi. Apparently floating point constants require a "." as in
> LESS_GENERIC_NEGZERO. Integer constants don't include the -, so
> GENERIC_NEGZERO is unary minus on integer 0 => integer zero. Promoted
> to double after that, so +0.0.
Yeah, it's logical. Just somewhat surprising.
I noticed that the following is assigned without warning (-Wall):
#define LESS_GENERIC_NEGZERO (-0.0)
int okthen = LESS_GENERIC_NEGZERO;
So it is tempting to decide that (-0.0) is ok for both floating
point and integer contexts. But that creeps me out.
Also, the following compiles without warning:
double w = -0.0;
int okmaybe = w;
Back to my semi-original question: Why is neg-zero a macro instead
of a floating-point constant?
- [Bug-gsl] GSL_NEGZERO, James Ward, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Brian Gough, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Gerard Jungman, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Brian Gough, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Gerard Jungman, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Gerard Jungman, 2011/04/13
- Re: [Bug-gsl] GSL_NEGZERO, Brian Gough, 2011/04/14
- Re: [Bug-gsl] GSL_NEGZERO,
Gerard Jungman <=
- Re: [Bug-gsl] GSL_NEGZERO, Brian Gough, 2011/04/15