Re: OT: Need help with numeric bases
From: | John Cowan <cowan@...> |
Date: | Tuesday, February 25, 2003, 11:03 |
Apollo Hogan scripsit:
> On Mon, 24 Feb 2003, Nik Taylor wrote:
>
> > Peter Clark wrote:
> > > Also, how does one go about converting the base of non-integer numbers?
> >
> > Division. For example, to convert, say, .125 into duodecimal,
> One can also do it with Multiplication: [...]
> For example, to convert 0.125 to base 7, we get: [...]
> A more interesting example, write PI in base 12:
Or for those of us with Real Computers:
$ bc
scale = 10
obase = 12
.125
.160
obase = 7
.125
.0606
obase = 12
3.141592653
3.184809490
^D
--
John Cowan http://www.ccil.org/~cowan cowan@ccil.org
To say that Bilbo's breath was taken away is no description at all. There
are no words left to express his staggerment, since Men changed the language
that they learned of elves in the days when all the world was wonderful.
--_The Hobbit_