Is there a better way to check if a value is bigger than of type double?
Posted
by user342231
on Stack Overflow
See other posts from Stack Overflow
or by user342231
Published on 2010-05-18T02:56:13Z
Indexed on
2010/05/18
3:00 UTC
Read the original article
Hit count: 192
double x;
cin>>x;
if( x > 1.7976931348623157e+308 || x < -1.7976931348623157e+308 )
{
cout<<"value not in range"<<endl;
exit(1);
}
Is there like a DOUBLE_MAX or DOUBLE_MIN and would I need to include any header files?
© Stack Overflow or respective owner