Click here to Skip to main content
15,904,153 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have to check the lower & upper limits for a float variable.
Problem is that when i check the lower limit of float with 'FLT_MIN' it just checks it with '0.0', which seems right since in 'float.h' it is defined as :

#define FLT_MIN 1.175494351e-38F /* min positive value */


But i want to check it for the minimum negative value for float ??

Is it possible..:confused:? If yes :-D ....can you please explain with a few lines of code ?

:-D THANKS IN ADVANCE :)
Posted

1 solution

FLT_MIN is the minimum positive value. If you want minimum negative value then use -FLT_MAX.

-Saurabh
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900