Sunday, 3 January 2016

IEEE floating point limitation specified in the standard

 

Floating point numbers are represented in the machine based on the IEEE 754 standard.
One of the limitation represented by the IEEE floating point standard is if we store the number "33554431" in the machine, while retrieving the number it is given as
"33554432"

This is one of the IEEE floating point exception or floating point error


Sample Program for floating point error:


#include<iostream>

int myFunction()
{
   return 0;
}

int main()
{
   float f=33554431;
   printf("\n  :: %f ", f );
   return 0;
}


Output:
  :: 33554432.000000