Question: 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

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!