Algebrator by Softmath - the leading Mathematics Software Application on the Market today! Algebra Software Tutoring Program provides exceptional supplemental teaching and reduces homework time

Home
News
Why Algebrator?
Iron-clad Guarantee
Testimonials and Reviews
Compare to Others
Order
Who we are
FAQs
Algebra Resource Links
Privacy Policy
Free tutoring with purchase!

Click here for a demo of Algebrator by SoftMath--reduce your Algebra homework to no time at all!
 

Softmath
1150 N Loop 1604 W
Ste. 108-453
San Antonio, TX 78248
USA

Phone: (512) 788-5675
Fax:    
(512) 519-1805

 
BBB Reliability Program -- Algebrator by SoftMath: reduce your homework time today!

Read the review of Algebrator Software in the Family Review Center today!

Bookmark and Share
 
 

CONVERTING BASE 2 FRACTION TO DECIMAL FRACTION

explanation of how to simplify expressions containing parentheses,pre algebra definitions open algebraic expression,factoring polynomials with a cubed term, tutorial,ti-83 plus solving systems of linear equations in three variables
Thank you for visiting our site! You landed on this page because you entered a search term similar to this: converting base 2 fraction to decimal fraction, here's the result:

How to Convert Fractions From Base 10 to Base K

Suppose you wish to convert a fraction from base 10 to somearbitrary base. How do you do this?

First, I should define what I mean by a fraction. I meana finite number digits right of the radix point. For example,0.875 is a fraction. 1.9 isn't, but that's OK, because wecan deal with values left of the radix point easily.

For example, suppose you want to convert 0.875 from base 10 tobase 2.

Here's one idea. Shift the decimal point to the right threeplaces. That results in 875. Then convert that to base 2.The shift the radix point back left three places.

Only, it doesn't work.

Why not? The answer lies in what it means to shift aradix point to the right or left. When you shift the radixpoint of 0.875 to the right by three spots, you're really multiplyingby 103.

However, once you convert 875 to base 2, and shift the radix pointto the left, you are dividing by 23, which is clearlynot the same as 103. You can't multiply by a number,then, divide by a different number and expect to get the same answer.

What's the right way to think about this?

It turns out to be more challenging than you might imagine, becausethe "solution" to this problem requires you to think differently.

Imagine that you have already converted the number to a differentbase. What would it look like? You may not know the digits, butyou know the form.

0.d-1d-2d-3...
That is, it has some digits after the radix point.

We're going to apply the following algorithm to solve the problem.For now, just assume that you can use negative indexes into arrays.

   index = -1 ;   while ( num > 0 )     {        num = num * base ; // Shift radix point to right by 1.        if ( num >= 1 )  // Case 1: num is greater than or equal to 1          {             digit[ index ] = (int) num ;  // keep only integer part             num -= (int) num ;  // get rid of value left of radix point          }         else  // num is less than 1            digit[ index ] = 0 ;         index-- ;     }
The key step is to realize what you're doing. You're multiplyingby the base, which is equivalent to shifting the radix point over by 1.Let's imagine what this does:
d-1 . d-2d-3...
At this point, d-1 is now left of the radix point.Since we multiplied by K, the only values d-1 can beare 0,..., K-1.

So, the idea is to see what value is left of the radix point.In a program, we can cast a floating point value to an int, to get the value left of the radix point (i.e., to throw away the rest ofthe fraction).

That value will be di.

We know that if, after we multiply by K, num > 0, thendi must be between 1 and K - 1. Once we determine whatdi is, and that it's value is greater than 1, then weneed to get rid of the value left of the radix point. Otherwise,when we make the check whether num > 0 in the if-statement,once it's true, it will be always true. We don't want that to happen.

Unfortunately, this algorithm may not terminate. For example,if you try to convert 0.3 to base 2, you'll end in an infiniteloop. Fortunately, since 0.3 is rational, there will bea repeated set of digits, so with careful coding, you can find stopthe loop once you see a set of digits repeat.

The loop terminates once the value reaches 0.

So, let's apply this algorithm to convert 0.625 to base 2.

  • Multiply 0.625 by 2. This results in 1.25. This value is bigger than 1, so find the integer part, which is 1. Set d-1 = 1 (i.e., set it to the integer part).
  • Since 1.25 is greater than or equal to 1, get rid of the integer part. This results in 0.25.
  • Decrement the index to -2.
  • Multiply 0.25 by 2 to get 0.5. This value is smaller than 1, so let d-2 = 0 (i.e., set it to the integer part, left of the radix point).
  • Since 0.5 is less than 1, leave it alone.
  • Decrement the index to -3.
  • Multiply 0.5 by 2 to get 1.0. This value is greater than or 1, so let d-3 = 1 (i.e., set it to the integer part, left of the radix point).
  • Since 1.0 is greater than or equal to 1, get rid of the integer part. This results in 0.0.
  • We're at 0, so exit the loop.
The value we get is 0.1012. If you convert it back tobase 10, you will find that it does equal 0.625.

How to Convert Arbitrary Floating Point to Base K

This algorithm works provided the number you're converting isless than 1. But what happens if you want to convert, say, 12.675to base 2. What do you do?

Fortunately, we can break it down into two cases.

  1. Convert the integer part to base K (as shown in earlier notes).
  2. Convert the fractional part to base K (as shown above).
  3. Add the two together.

Summary

The key idea of converting a fraction (i.e., a value with a finitenumber of digits right of the radix point) is to multiply repeatedlyby K, and determine if the result is bigger than 1 or not. If so,store the integer part in an array. If not, store 0 in the array.

Then, subtract off the integer part. Repeat until the number is0. If the number is 0, it may simply be a repeated fraction.

To convert arbitrary floating point in base 10 to arbitrarybases, solve the problem by converting the integer part to base Kand the fractional part to base K. Add the two parts together.


You Type in Your Algebra Problem. Algebrator does the Rest!


 


Algebrator
Download (and optional CD)

Only $39.99

Click to Buy Now:



OR


Goods and services provided by Sofmath (TX, USA).
Sold by 2CheckOut.com Inc. (Ohio, USA).

Attention: We are currently running a special promotional offer for softmath.com visitors -- if you order Algebrator by midnight of November 20th you will pay only $39.99 instead of our regular price of $74.99 -- this is 35.00 in savings ! In order to take advantage of this offer, you need to order by clicking on one of the buttons on the left, not through our regular order page.

If you order now you will also receive 30 minutes of live math tutoring from tutor.com!

You Will Learn Algebra Better - Guaranteed!

Just take a look how incredibly simple Algebrator is:

Step 1 : Enter your homework problem in an easy WYSIWYG (What you see is what you get) algebra editor:

Step 2 : Let Algebrator solve it:

Step 3 : Ask for an explanation for the steps you don't understand:

Algebrator can solve problems in all the following areas:

  • simplification of algebraic expressions (operations with polynomials (simplifying, degree, synthetic division...), exponential expressions, fractions and roots (radicals), absolute values)
  • factoring and expanding expressions
  • finding LCM and GCF
  • operations with complex numbers (simplifying, rationalizing complex denominators...)
  • solving linear, quadratic and many other equations and inequalities (including basic logarithmic and exponential equations)
  • solving a system of two and three linear equations (including Cramer's rule)
  • graphing curves (lines, parabolas, hyperbolas, circles, ellipses, equation and inequality solutions)
  • graphing general functions
  • operations with functions (composition, inverse, range, domain...)
  • simplifying logarithms
  • operations with matrices (adding, subtracting, multiplying, inverse...)
  • basic geometry and trigonometry (similarity, calculating trig functions, right triangle...)
  • arithmetic and other pre-algebra topics (ratios, proportions, measurements...)


Algebrator
Download (and optional CD)

Only $39.99

Click to Buy Now:



OR


Goods and services provided by Sofmath (TX, USA).
Sold by 2CheckOut.com Inc. (Ohio, USA).

 
Order $58.99
 

 

 
 
Demo | Features | Guarantee | Reviews | Comparison | Order | About Us

©Copyright 1998 - 2009 Softmath All rights reserved.