Pelles C forum

C language => Beginner questions => Topic started by: jordantoto on November 10, 2018, 08:18:37 AM

Title: Floating point overflow results
Post by: jordantoto on November 10, 2018, 08:18:37 AM
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.