Code: Select all
// Constants
const Simple SimplePositiveInfinity = Simple(1.0f) / Simple(0.0f);
const Simple SimpleNegativeInfinity = Simple(-1.0f) / Simple(0.0f);
// TODO: non-signaling version
const Simple SimpleNaN = SimplePositiveInfinity + SimpleNegativeInfinity;
const Double DoublePositiveInfinity = Double(1.0f) / Double(0.0f);
const Double DoubleNegativeInfinity = Double(-1.0f) / Double(0.0f);
// TODO: non-signaling version
const Double DoubleNaN = DoublePositiveInfinity + DoubleNegativeInfinity;
Also, using special typedefs for Double etc. seems strange, as the standard library already provides double that should be good for all purposes where Double would be used. Obviously, using the numeric_limits as instructed above may also be done where needed instead of a special header (granted, though, that they are a bit ugly).