Pelles C forum

C language => Beginner questions => Topic started by: PaoloC13 on April 27, 2019, 04:00:06 AM

Title: FLT_MIN
Post by: PaoloC13 on April 27, 2019, 04:00:06 AM
I tested my system to see which smallest number could be non-zero.

My result is this:

   float x = 8.0e-46f; // != 0.0f.
   float y = 7.0e-46f; // == 0.0f.

but I see in float.h that:

#define FLT_MIN    1.175494351e-38F

So, why this difference?
May be that FLT_MIN is system-dependent?
Title: Re: FLT_MIN
Post by: TimoVJL on April 27, 2019, 09:23:18 AM
IEEE 754 standard
Single-precision floating-point format (https://en.wikipedia.org/wiki/Single-precision_floating-point_format)
Title: Re: FLT_MIN
Post by: PaoloC13 on April 27, 2019, 02:21:52 PM
Well, so I met the smallest positive subnormal number, or may be the minimal rounded position for it.