Subject: Re: Base converter page
Date: Tue, 8 Jul 1997 21:27:21 -0400
From: Alexander Bogomolny

Hello, Leo:

Yes, of course, there is a way to convert decimals. One caveat though. You have to split the integer and decimal parts and convert them separately.

To convert the decimal part you have to multiply instead of dividing. Be careful with the limited precision arithmetic of JavaScript. I.e., beware that sooner or later you'll get meaningless digits.

To get a grasp on the algorithm take something simple like 1/16+1/8+1/2 = .6875 and keep multiplying by 2. Keep track of digits that pop up to the left of the decimal point:

0.6875
.
1.375
0.75
1.5
1.0

Now conclude that in binary the decimal .6875 equals 0.1011. The same approach applies to other bases.

All the best,
Alexander Bogomolny

|Reply| |Up|

Copyright © 1996-2012 Alexander Bogomolny

 41169623

A math books store at a unique math study site. Shopping at the store helps maintain the site. Thank you.
Sites for teachers
Sites for parents
Terms of use
Awards
Interactive Activities

CTK Exchange
CTK Wiki Math
CTK Insights - a blog
Math Help
Games & Puzzles
What Is What
Arithmetic
Algebra
Geometry
Probability
Outline Mathematics
Make an Identity
Book Reviews
Stories for Young
Eye Opener
Analog Gadgets
Inventor's Paradox
Did you know?...
Proofs
Math as Language
Things Impossible
Visual Illusions
My Logo
Math Poll
Cut The Knot!
MSET99 Talk
Old and nice bookstore
Other Math sites
Front Page
Movie shortcuts
Personal info
Privacy Policy

Guest book
News sites

Recommend this site

Sites for parents

Education & Parenting

Search:
Keywords:

Google
Web CTK
Supported by
3wVentures