Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help fixing this code. It is in python and I have not done python in a very long time. this is the prompt

I need help fixing this code. It is in python and I have not done python in a very long time.

this is the prompt

Using a technique explained in the class, calculate the number of mantissa digits and the unit round-off on the machine that you will use for this course. You need to know the number for analyzing errors in this and other home-works and, therefore, we will not be checking your computer projects until you show us (grader or me) a correct solution to this problem.

def main():

k=1.0

x=0.5 sold=2.0 snew=1.0+x huh=0.0

while(huh!=k): if (snew==sold)or(snew==1.0): print(k) print() print(x) else: x=x/2.0

k=k+1 sold=snew snew=1+x huh=k+x

main()

CODE IS NOT UNDERSTANDABLE THATS WHY I ASKED FOR HELP!!!! CODE SEEN IS WHAT WAS GIVEN IN CLASS. IF YOU CANT HELP DO NOT SEND BACK FOR MORE INFORMATION I CAN NOT GIVE.

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

Development Of Knowledge Framework For Affective Content Analysis

Authors: Swarnangini Sinha

1st Edition

B0CQJ13WZ1, 979-8223977490

More Books

Students also viewed these Databases questions

Question

EXPLAIN the five steps in the performance management process.

Answered: 1 week ago