Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

minimum double value in C/C++

Tags:

c++

c

math

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.

like image 801
Will Avatar asked Jul 20 '09 13:07

Will


People also ask

What is the minimum value of double?

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.

What is the maximum double value in C?

The value of this constant is positive 1.7976931348623157E+308. The result of an operation that exceeds Double. MaxValue is Double.

What is the minimum value of double in C++?

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 ...


1 Answers

-DBL_MAX in ANSI C, which is defined in float.h.

like image 160
dfa Avatar answered Oct 21 '22 19:10

dfa