Author Topic: Refresh my memory please, dealing with multiple '='  (Read 5478 times)

0 Members and 1 Guest are viewing this topic.

Offline SMcNeill

  • QB64 Developer
  • Forum Resident
  • Posts: 3972
    • View Profile
    • Steve’s QB64 Archive Forum
Re: Refresh my memory please, dealing with multiple '='
« Reply #15 on: December 06, 2021, 12:59:12 pm »
@George McGinn -- limitations of variable types.  Floating point numbers have a representation for NAN; Integers don't. 

In 32-bit floats, NAN is stored as: 0x7fc00000.

First bit is 0 for sign.
Next 8 bits are set for a value of 255.  (Special)
Mantissa is 1 with all zeroes...

Which represents NAN.

Integers don't have such an encoding built into them, thus integer division doesn't return it as a result.

https://gregstoll.com/~gregstoll/floattohex/
https://github.com/SteveMcNeill/Steve64 — A github collection of all things Steve!