Math unit: MaxSingle is not precisely the maximum positive single point float

Original Reporter info from Mantis: Erik Roessiger @erikroe
  • Reporter name: Erik Rößiger

Description:

In the Math unit of FPC, MaxSingle is defined as follows (line 75):

MaxSingle = 3.4e+38;

Assigning this value to any Single variable outputs the following hexadecimal representation: $7F7F C99E
However, the correct maximum single point precision is defined as $7F7F FFFF.

MaxSingle should be changed to this:

MaxSingle = Single(3.402823466E+38);

The output hexadecimal representation of it gives exactly $7F7F FFFF.
Note the Single() cast, else it will be treated incorrectly.

Mantis conversion info:

  • Mantis ID: 36870
  • Version: 3.3.1
  • Fixed in version: 3.3.1
  • Fixed in revision: 44714 (#cd35cdad)