We help IT Professionals succeed at work.

PI in binary

319 Views
Last Modified: 2008-01-09
Help.

How does pi in binary corelate to normal binary numbers?
ie
      11.00100100001111110110
I can see the binary 3.
11.
11 = 3 in binary.  I got it...

but 1 = 1 in binary.  and 4 = 100.  
where does that fit in?
Comment
Watch Question

Top Expert 2007

Commented:
If this were some BinaryCodedDecimal encoding scheme for floating point values, your interpretation would be correct. However, if this is a dump of a binary floating point value, you can treat it as a series of sums to get the correct result, as:
   1 * (2^ 1)
+ 1 * (2^0)
+ 0 * (2 ^ -1)
+ 0 * (2 ^ -2)
+ 1 * (2 ^ -3)

etc, decrementing the power of two by one for each successive binary digit.

Jim

Author

Commented:
whoa.  LOL  you are going to have to dumb that one down for me.  That's basically what I saw on google.  my problem is I tried to do the math my self and cant come up with the same answer.
Can you show me just 3.14 in binary and how you got to the answer.

thanks
Top Expert 2007
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
Top Expert 2007

Commented:
BTW,  that was not 3.14 exactly. Those were the most significant bits you supplied for Pi. I do not have an easy way to get a dump of a binary representation for the value 3.14 any more.

Jim
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION
t0 512 binary digits, PI in binary is

11.
00100100 00111111 01101010 10001000 10000101 10100011 00001000 11010011
00010011 00011001 10001010 00101110 00000011 01110000 01110011 01000100
10100100 00001001 00111000 00100010 00101001 10011111 00110001 11010000
00001000 00101110 11111010 10011000 11101100 01001110 01101100 10001001
01000101 00101000 00100001 11100110 00111000 11010000 00010011 01110111
10111110 01010100 01100110 11001111 00110100 11101001 00001100 01101100
11000000 10101100 00101001 10110111 11001001 01111100 01010000 11011101
00111111 10000100 11010101 10110101 10110101 01000111 00001001 00010111


go to Google, search for "Pi in Binary"

AW
ozo
CERTIFIED EXPERT
Most Valuable Expert 2014
Top Expert 2015

Commented:
perl -e '$x=atan2(1,1)*4; for( 1..20 ){ printf"%b",int $x; $x -= int $x; $x *= 2; }'
110010010000111111011
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.