Question: 1 . 2 . 4 Arbitrary accuracy Download the file expand.py from the VLE which contains the code for the three methods: expand, expand _

1.2.4 Arbitrary accuracy
Download the file
expand.py from the VLE which contains the code for the three methods: expand, expand_integer_part and expand_fractional_part. Place them in the Rational class and check you understand how they are used to convert a rational number to any base (like decimal), and to any number of digits. For example,
In [1]: Rational (1,4).expand (10,4)
Out [1]: 10.25(base 10)'
10
CHAPTER 1. COMPUTATIONAL ACCURACY
In [2]: Rational (1,7). expand (10,30)
Out [2] : '0.142857142857142857142857142857(base 10)'
Experiment with these conversion functions. What is the 100th decimal place of e? How many terms in the partial sum are necessary to establish this?
 1.2.4 Arbitrary accuracy Download the file expand.py from the VLE which

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!