Answered step by step
Verified Expert Solution
Link Copied!

Question

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 to Expert-Tailored 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

Recommended Textbook for

DB2 11 The Ultimate Database For Cloud Analytics And Mobile

Authors: John Campbell, Chris Crone, Gareth Jones, Surekha Parekh, Jay Yothers

1st Edition

ISBN: 1583474013, 978-1583474013

More Books

Students also viewed these Databases questions