Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Working with NAN
#3
Pure Basic has a NAN "function". The trick is to find an especially-encoded 32-bit or 64-bit floating-point value to represent NAN. Find two others to represent positive and negative infinity. Maybe another one to represent the square root of -1. And so on.

FROM:
https://en.wikipedia.org/wiki/NaN#Floating_point

Quote:IEEE 754 NaNs are encoded with the exponent field filled with ones (like infinity values), and some non-zero number in the significand field (to make them distinct from infinity values); this allows the definition of multiple distinct NaN values, depending on which bits are set in the significand field, but also on the value of the leading sign bit (but applications are not required to provide distinct semantics for those distinct NaN values).

For example, an IEEE 754 single precision (32-bit) NaN would be encoded as
s111 1111 1xxx xxxx xxxx xxxx xxxx xxxx

where s is the sign (most often ignored in applications) and the x sequence represents a non-zero number (the value zero encodes infinities). In practice, the most significant bit from x is used to determine the type of NaN: "quiet NaN" or "signaling NaN" (see details in Encoding). The remaining bits encode a payload (most often ignored in applications).
Reply


Messages In This Thread
Working with NAN - by Dimster - 09-08-2023, 03:45 PM
RE: Working with NAN - by DSMan195276 - 09-08-2023, 03:57 PM
RE: Working with NAN - by mnrvovrfc - 09-08-2023, 04:03 PM
RE: Working with NAN - by Dimster - 09-08-2023, 06:06 PM
RE: Working with NAN - by mnrvovrfc - 09-08-2023, 06:22 PM
RE: Working with NAN - by DSMan195276 - 09-08-2023, 07:43 PM
RE: Working with NAN - by Dimster - 09-09-2023, 01:42 PM
RE: Working with NAN - by DSMan195276 - 09-09-2023, 02:31 PM
RE: Working with NAN - by Dimster - 09-09-2023, 03:48 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 05:03 PM
RE: Working with NAN - by Dimster - 09-09-2023, 06:48 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 07:11 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 07:26 PM
RE: Working with NAN - by SMcNeill - 09-09-2023, 08:15 PM
RE: Working with NAN - by grymmjack - 09-10-2023, 12:24 AM
RE: Working with NAN - by eoredson - 09-15-2023, 03:03 AM



Users browsing this thread: 6 Guest(s)