Header for MAXDOUBLE

In what header is max value for double defined?

Upvotes: 1

Views: 6994

Answers (5)

hansmaad
hansmaad

Reputation: 18905

#include <limits>
int main()
{
  std::cout << "Maxvalue for double: " << std::numeric_limits<double>::max();
  return 0;
}

Upvotes: 19

Kyrylo Kovalenko
Kyrylo Kovalenko

Reputation: 2171

On my system (VS 10) it's float.h. The define is DBL_MAX 1.7976931348623158e+308

Upvotes: 3

Alex Deem
Alex Deem

Reputation: 4805

If you're using C++ the standard way of achieving this is with:

#include <limits>
std::numeric_limits< double >::max();

Upvotes: 11

rplusg
rplusg

Reputation: 3446

If you are working with VS, you can see this link: http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx

Upvotes: 0

Georg Fritzsche
Georg Fritzsche

Reputation: 99044

There is cfloat, which gives you DBL_MAX.

Upvotes: 1

Related Questions