Post Reply 
(Free42) tips & tricks: local flags
07-24-2020, 11:14 AM
Post: #13
RE: (Free42) tips & tricks: local flags
(07-24-2020 10:19 AM)Paul Dale Wrote:  A 64 bit binary float can safely hold 62 flags:
  • the mantissa holds 52 (the 53rd bit doesn't exist since it's always 1);
  • the sign bit holds 1 and
  • the exponent holds 9 (despite being 11 bits long, it shouldn't be all 0 or all 1 to avoid NaNs, infinities and subnormals).

Avoiding Inf/NaN and subnormal/zero, exponent range = 2^11 - 2, thus able to hold 10 flags.

But, if we use binary float to hold flags, there is no reason to avoid them.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: (Free42) tips & tricks: local flags - Albert Chan - 07-24-2020 11:14 AM



User(s) browsing this thread: 1 Guest(s)