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.

Skip to content
# C++ – minimum double value in C/C++

###### Related Question

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.

- C++ – What should main() return in C and C++
- Java – Fastest way to determine if an integer’s square root is an integer
- C++ – Why can templates only be implemented in the header file
- Sqlite – Improve INSERT-per-second performance of SQLite
- Easy interview question got harder: given numbers 1..100, find the missing number(s) given exactly k are missing
- C++ – Image Processing: Algorithm Improvement for ‘Coca-Cola Can’ Recognition
- C++ – the difference between ‘typedef’ and ‘using’ in C++11
- C++ – Can code that is valid in both C and C++ produce different behavior when compiled in each language

## Best Solution

`-DBL_MAX`

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