Author Topic: yeongJIN_COOL's Universal base converter  (Read 7163 times)

0 Members and 1 Guest are viewing this topic.

Ashbad

  • Guest
Re: yeongJIN_COOL's Universal base converter
« Reply #15 on: March 30, 2011, 01:20:23 pm »
It's not terribly difficult to do. For example, let's try something like 10.5
To convert this to binary, convert the 10 as normal (1010) and then we'll deal with the decimal. Now, decimals in binary are calculated like this: every nth decimal place after the period is calculated as 1/2n. Since .5 is equal to 1/21, it's equal to 0.1
Add this to the integer and you have your binary decimal 1010.1

:)

Damn, converting pi that way would suck... :P