I was considering a way to represent any real number by a binary fraction in ( -1, +1 ). Here's the function that maps the representation to the number represented. I typed it into Python and tried it out pretty much this way:
def sb( x ): ... if abs(x) >= 1: ... raise ValueError ... elif x < 0: return -sb( -x ) ... elif x == 0: return 0.0 ... else: return 2.0 ** sb( 2.0 * x - 1.0 ) ... sb( 0 ) 0.0 sb( .5 ) 1.0 sb( .75 ) 2.0 sb( 7.0 / 8.0 ) 4.0 sb( 15.0 / 16.0 ) 16.0 sb( 31.0 / 32.0 ) 65536.0 sb( 1.0 / 3.0 ) 0.641185744504986
...wait. Why did that last line return anything at all? Does the function I'm computing have a name? Just looking at the Python procedure, how do you think it computes sb( 1/3 )? (I've never seen an algorithm (if you can even call it that) work like this.) Without going to Google, Plouffe's Inverter or a calculator, what's the significance of 0.641185744504986? You can find it by expanding sb( 1/3 ) three steps. http://www.tiac.net/~sw/2010/03/Superbola --Steve