MAXFLOAT in Objective-C

The maximum float value is ignored as:

math.h

#define    MAXFLOAT    0x1.fffffep+127f

I'm a little sad that I had not noticed this before. What does this actually say? I would expect something like this:

#define    MAXFLOAT    0xFFFFFFFF-1

Will this work?

+5
source share
2 answers

0x1.fffffep+127 (approximately) 1.9999999999999999999999998 times 2 ^ 127. This is a floating point number with an index in hexadecimal format.

  • 0x= hexadecimal notation
  • 1= integer part of a number
  • .fffffe= fractional part of a number
  • p+127= scientific notation for “from two to 127th degree”
+8
source

MAXFLOAT required for UNIX compliance:

MAXFLOAT

     

[XSI] The value of the maximum number of infinite single-precision floating-point numbers.

0x1.fffffep+127f - , C .

C , FLT_MAX <float.h>, ( " ", § 5.2.4.2.2). FLT_MAX - , .

+5

All Articles