Equation

Discussion in 'The Cesspool' started by Spectrum, Feb 1, 2011.

Thread Status:
Not open for further replies.
  1. Spectrum Registered Senior Member

    Messages:
    459
    I cannot find the thread but someone was looking for some equations. Here is one that counts in binary i.e. moves a one into the next significant bit each time: X*2+1;

    1
    11
    111
    1111
    11111
    111111
    1111111
    11111111

    Here is another one:

    Code:
    a%=0
    b%=1
    do
    b%=b%/2
    a%=a%+b%
    print a%
    loop while a%<>1
    

    Please Register or Log in to view the hidden image!

     
  2. Guest Guest Advertisement



    to hide all adverts.
  3. Pinwheel Banned Banned

    Messages:
    2,424
  4. Guest Guest Advertisement



    to hide all adverts.
  5. Gremmie "Happiness is a warm gun" Valued Senior Member

    Messages:
    2,593
    You mean you don't understand this, Pin?...it means umm, well you know...

    Yeah, I don't get it either..

    Please Register or Log in to view the hidden image!

     
  6. Guest Guest Advertisement



    to hide all adverts.
  7. James R Just this guy, you know? Staff Member

    Messages:
    36,974
    Pretty obvious, since to multiply any binary number by 2 you just add a zero on the end. (i.e. in binary 111 times 10 = 1110, which in decimal says 7 times 2 = 14).

    This one prints (in binary):

    0.1
    0.11
    0.111
    0.1111

    etc.

    Why is any of this important?
     
Thread Status:
Not open for further replies.

Share This Page