Floating point overflow results

Started by jordantoto, November 10, 2018, 08:18:37 AM

Previous topic - Next topic

jordantoto

code:
#include<stdio.h>
#include<float.h>

int main(void)
{
   float toobig=FLT_MAX*100.0f;

   printf("%e\n",toobig);

   return 0;
}


#define FLT_MAX      3.402823466e+38F


Why is this code on pelles C the result of the float type variable toobig is larger than the float maximum? Why does overflow overflow display inf?

It looks like pelles C directly takes the result of toobig as the double type.