PDA

View Full Version : Max/min float and double



Téragone
March 31st, 2006, 01:32 AM
In which .h file max/min float and double are defined ?

Thanks

JmSchanck
March 31st, 2006, 05:59 AM
math.h provides fmax() and fmin() for double values. I'm pretty it also provides functions for float and long double values by appending an f or an l to the function names.

lovebyte
March 31st, 2006, 11:28 AM
Ints are defined in /usr/include/limits.h

Floats (and doubles) are defined in float.h. On my machine at work (fedora) it is in :
/usr/lib/gcc/i386-redhat-linux/3.4.3/include/float.h

You might want to try a find command such as:
find /usr -name float.h -print

rplantz
March 31st, 2006, 05:46 PM
You might want to try a find command such as:
find /usr -name float.h -print

Also,

$ locate float.h
/usr/share/doc/rubybook/html/ref_c_float.html
/usr/lib/gcc/x86_64-linux-gnu/4.0.2/include/float.h

will help you find it.

Téragone
April 1st, 2006, 12:45 AM
Thanks very much to all.

I also find that for c++ we can use :

std::numeric_limits<double>::max()
std::numeric_limits<float>::max()

LordHunter317
April 1st, 2006, 04:22 PM
'float' and 'double' aren't defined anywhere as they're part of the language.