max double

Matthew Saltzman mjs at ces.clemson.edu
Sat Dec 16 09:41:21 UTC 2006


On Fri, 15 Dec 2006, Steve Siegfried wrote:

> Mike - EMAIL IGNORED wrote:
>>
>> On Fri, 15 Dec 2006 19:44:42 -0500, Mike - EMAIL IGNORED wrote:
>>
>>> How do I find the max double on my FC4?
>>> Thanks,
>>> Mike.
>>
>> Mia culpa. I see that I did not clearly state my question.
>> What include file and macro should I use to get the max
>> double in a c++ program?
>>
>> Thanks again,
>> Mike.
>
>
>
> #include <math.h>

Don't need that one.

> #include <float.h>

Do need that one, though #include <cfloat> is preferred for C++.

Also need <cstdio> or <stdio.h> for C-style i/o or <iostream> for C++ 
stream i/o.

>
> then reference "LDBL_MAX"

DBL_MAX for doubles, LDBL_MAX for long doubles.

If you use C-style i/o, be careful about format specifiers for printf() 
when printing long doubles (or long anything).

-- 
 		Matthew Saltzman

Clemson University Math Sciences
mjs AT clemson DOT edu
http://www.math.clemson.edu/~mjs




More information about the fedora-list mailing list