D
Dave Rahardja
Does the C++ standard specify the behavior of floating point numbers during
"exceptional" (exceptional with respect to floating point numbers, not
exceptions) conditions?
For example:
double a = 1.0 / 0.0; // What is the value of a? Infinity?
double b = 0.0 / 0.0; // What is the value of b? NaN?
What about overflow/underflow conditions in the library? Is HUGE_VAL always a
defined constant?
#include <cmath>
using namespace std;
double c = pow(1e100, 1e100); // What is the value of c?
double d = pow(0.5, 1e100); // What is the value ef d?
"exceptional" (exceptional with respect to floating point numbers, not
exceptions) conditions?
For example:
double a = 1.0 / 0.0; // What is the value of a? Infinity?
double b = 0.0 / 0.0; // What is the value of b? NaN?
What about overflow/underflow conditions in the library? Is HUGE_VAL always a
defined constant?
#include <cmath>
using namespace std;
double c = pow(1e100, 1e100); // What is the value of c?
double d = pow(0.5, 1e100); // What is the value ef d?