# Equation

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

Not open for further replies.
1. ### SpectrumRegistered 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


Messages:
2,424
???

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..

7. ### James RJust this guy, you know?Staff Member

Messages:
37,081
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?