Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • Thanks, it is good that this works for 64bit.. Can you let me know any advantages of this answer over annan's answer? Commented Jul 24, 2017 at 21:51
  • 4
    Much larger range? It works for -(2**53)-1 to 2**53-1 instead of just -(2**31) to 2**31-1 like annan's answer. Commented Jul 24, 2017 at 22:01
  • Yes that is a big advantage, I get that, and that will do, though it is quite a bit more code, but what I meant was, i'm curious if any other advantages? Commented Jul 25, 2017 at 14:31
  • 1
    from 2**32+1 on, last (rightmost) bit is cleared when it should be set. Commented Nov 10, 2018 at 17:25
  • 1
    Works when the line is: var exponent = ((uint16[3] & 0x7FF0) >> 4) - 1023 + 1; Commented Nov 10, 2018 at 17:33