Get the float maximum/minimum value - C++ Data Type

C++ examples for Data Type:float

Description

Get the float maximum/minimum value

Demo Code

#include <iostream>
#include <cfloat>

int main()/*  w w  w . j a  va2 s .c  o m*/
{
  std::cout << "The mantissa for type float has " << FLT_MANT_DIG << " bits." << std::endl;
  std::cout << "The maximum value of type float is " << FLT_MAX << std::endl;
  std::cout << "The minimum non-zero value of type float is " << FLT_MIN << std::endl;
}

Result


Related Tutorials