INFINITY and -pedantic with gcc
INFINITY and -pedantic with gcc
- Subject: INFINITY and -pedantic with gcc
- From: Jasmin Lapalme <email@hidden>
- Date: Wed, 3 Aug 2005 14:59:05 -0400
Hi,
I have curious bug with gcc and the option -pedantic.
I want to use the value INFINITY defined in math.h. Here is a
sample code :
==== test.cpp ====
#include <cmath>
#include <iostream>
using namespace std;
void test_inf(double &x) {
x = INFINITY;
}
int main() {
double x;
test_inf(x);
cout << x << endl;
}
===========
This code compiles well without the option -pedantic but I want
to use the option -pedantic. I want to be sure my code will compile
on any platform with gcc. I know that INFINITY is equal to 1e50f and
1e50f is greater than FLT_MAX. The option -pedantic raise this
error : floating constant exceeds range of 'float'.
Why I cannot use INFINITY with the option -pedantic?
Thanks
Jasmin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden