Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

in Python please For this section and the next, use formatted printing to print out 16 digits after the decimal point for your real numbers.

in Python please

image text in transcribed

For this section and the next, use formatted printing to print out 16 digits after the decimal point for your real numbers. (a) Define a variable called eps, put the value of the machine epsilon for double precision float in it, and print it out. That is, the smallest number you can fit in the mantissa section. Print out 1.+ eps and 1.+ eps /2 separately, include the results as comments in your program and explain why you get those values. (b) Print out the smallest double precision float using 2.0**-1074. Then, try to print 2.0**-1075. Explain what you find. (c) Write a simple loop that converts the largest binary number that can be stored as the mantissa of a double-precision float, 1.11111, to base-10. You should find 2252. Check that and explain why. (d) Given (c), what do you think is the largest power of 2.0 you can use before encountering an overflow? Try it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions