Answered You can hire a professional tutor to get the answer.

QUESTION

Calculate square root of a floating-point number We could use a similar technique to calculate the result of a positive floating point number a...

Calculate square root of a floating-point number

We could use a similar technique to calculate the result of a positive floating point number a

a divided by a positive floating point number b

b, by using only additive and multiplicative operations. You can assume that the result will not exceed sys.float_info.max.

Similar to Exercise 0, for division using the bisection method we need an interval to start with. If b<1.0

b<1.0 the bounds for the upper bound for the searching interval is sys.float_info.max, with a as the lower bound.

Exercise 3 Determine the searching interval, depending upon a and b

Calculate square root of a floating-point number We could use a similar technique to calculate the result of a positive floating point number a divided by a positive floating point number I), by using onlyadditive and multiplicative operations. You can assume that the result will not exceed sys . float_info .max. Similar to Exercise 0, for division using the bisection method we need an interval to start with. If I) &lt; 1.0 the bounds for the upper bound for the searchinginterval is sys.float_info.max, with a as the lower bound. Exercise 3 Determine the searching interval, depending upon a and b. def division_searching_interval(a, b) :##Begin solution ##End solution #Test cell: Ex_3_test assert division_searching_interval(4,2) == (0.0, 4), &quot;Incorrect, please try again&quot; assert division_searching_interval(2,4) == (0.0, 2), &quot;Incorrect, please try again&quot; assert division_searching_interval(10,0.5) == (10, sys.float_info.max), &quot;Incorrect, please try again&quot;assert division_searching_interval(38, 1) == (0.0, 38), &quot;Incorrect, please try again&quot; print( &quot; \nPassedl &quot;)
Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question