I guess you know about 2-adic numbers? -1 is an infinite sequence of 1 bits ("2's complement with an infinite number of bits"), and if x = ...0101 then 2x = ...1010 so x + 2x = 3x = ...1111 = -1 hence x = -1/3.
-
-
-
Fun overview of a particular application here: http://blog.sigfpe.com/2010/05/optimising-pointer-subtraction-with-2.html …
- 3 more replies
New conversation -
-
-
How to handle non-unique expansions? e.g. "0.1 & 0.1 = 0.1" vs "0.1 & 0.0111... = 0".
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Fun and thought-provoking! If you flip the bit in the 2^0 position, why not the bit in the 2^1 position? And 2^2, and so on? I don't know how mathematically rigorous the bit tricks we know and love in CS are once you worry about infinitely large words.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
where is the cube going
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I seem to have run into this in other coding languages as well. What other code languages use this same sort of math?
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.