Is there a standard and/or portable way to represent the smallest negative value (e.g. to use negative infinity) in a C(++) program?
DBL_MIN in float.h is the smallest positive number.
The minimum value a double can have. The lowest minimum value that a double can have is 2.2250738585072014E-308. Constructs a Double wrapper for the specified double value. Constructs a Double object initialized to the value specified by the String parameter.
The value of this constant is positive 1.7976931348623157E+308. The result of an operation that exceeds Double. MaxValue is Double.
short: min: -32768 max: 32767 int: min: -2147483648 max: 2147483647 long: min: -2147483648 max: 2147483647 float: min: 1.17549e-038 max: 3.40282e+038 double: min: 2.22507e-308 max: 1.79769e+308 long double: min: 2.22507e-308 max: 1.79769e+308 unsigned short: min: 0 max: 65535 unsigned int: min: 0 max: 4294967295 ...
-DBL_MAX
in ANSI C, which is defined in float.h.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With