Fundamental Mathematics from an Advanced Standpoint

Math 4303 - Fall 2009

Helmut Knaust, Department of Mathematical Sciences, UTEP, El Paso TX 79968
hknaust@utep.edu

Last Edits: 9/17/09

Calculating the Decimal Representation of Fractions on a Cheap Calculator, Part II

We want to compute the decimal representation of 1/19. The fraction 1/19 has a simple-periodic decimal representation with period 18.

N[1/19,25]

We want to extract 6 digits at a time.

Step 1

Using the Division Algorithm, we can write

Print[1/19," = ",HoldForm[52631 10^(-6)+11/19 10^(-6)]]

The first summand on the right side gives us the first six digits, the second term the "remainder". Note that since 1/19<1, the numerator of the first summand has at most six digits, while the remainder term will start with six zeros after the decimal point.

NF[x_]:=NumberForm[N[x,30],{27,27},ExponentFunction->(Null&)]
ColumnForm[{NF[52631 10^(-6)],NF[11/19 10^(-6)]}]

Step 2

We now apply the Divison Algorithm to the second term on the right:

Print[HoldForm[11/19 10^(-6)]," = ",HoldForm[578947 10^(-12)+7/19 10^(-12)]]

Combining with Step 1, we have:

Print[1/19," = ",HoldForm[52631 10^(-6)+578947 10^(-12)+7/19 10^(-12)]]

Here are the three numbers on the right in decimal form :

ColumnForm[{NF[52631 10^(-6)],NF[578947 10^(-12)],NF[7/19 10^(-12)]}]

Step 3

We again apply the Divison Algorithm to the last term on the right:

Print[HoldForm[7/19 10^(-12)]," = ",HoldForm[368421 10^(-18)+1/19 10^(-18)]]

Combining with Step 1 and Step 2, we have:

Print[1/19," = ",HoldForm[52631 10^(-6)+578947 10^(-12)+368421 10^(-18)+1/19 10^(-18)]]

Here are the four numbers on the right in decimal form :

ColumnForm[{NF[52631 10^(-6)],NF[578947 10^(-12)],NF[368421 10^(-18)],NF[1/19 10^(-18)]}]