Question: 3 . 5 7 LAB: Comparing floats Instructor note: Remember, floating - point numbers only have limited precision and calci One way to compare equality
LAB: Comparing floats
Instructor note:
Remember, floatingpoint numbers only have limited precision and calci One way to compare equality is to take the absolute value use a math to "equal" and "epsilon", where EQUAL and epsilon is just th The order of input being read is: value value and epsilon st a final "else" to compare if equal, close enough, or not close.
Write a program that is given two floats for comparison and a third float th phrases:
output "equal" if the floats are within exclusively of each othe
output "close enough" if the floats are within epsilon exclusively of
outpulnot close" if floats are not within epsilon
Ex: If the input is:
the output is:
close enough
Ex: If the input is:
the output is:
equal
Ex: If the input is:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
