Duplicate Question
The question on this page has been marked as a duplicate question.
Original Question
design and implement such a function and use it in a program called part3.c that allows someone to enter two real numbers and a...Asked by apoorva
design and implement such a function and use it in a program called part3.c that allows someone to enter two real numbers and an epsilon value (also a real number) and reports if the two numbers are equal (+/- epsilon) or not.
If you were asked this question, how would you try to understand this question;
This is how I looked at it;
I'm asked for two real numbers and an epsilon number.
for example, 5 and 6. epsilon is then 2.
So when I compile my program, my program will do this: 5+2 and 5-2 which is 7 and 3
and 6+2 and 6-2 which is 8 and 4.
Then the result I would have program say would be: No, this is not equal.
Am I reading this right, please help
If you were asked this question, how would you try to understand this question;
This is how I looked at it;
I'm asked for two real numbers and an epsilon number.
for example, 5 and 6. epsilon is then 2.
So when I compile my program, my program will do this: 5+2 and 5-2 which is 7 and 3
and 6+2 and 6-2 which is 8 and 4.
Then the result I would have program say would be: No, this is not equal.
Am I reading this right, please help
Answers
Answered by
bobpursley
no, I don't think you are reading it correctly
Here is the logic a,b real numbers, e is some real number.
IF abs(a-b)<=e then YES
otherwise NO
Here is the logic a,b real numbers, e is some real number.
IF abs(a-b)<=e then YES
otherwise NO
There are no AI answers yet. The ability to request AI answers is coming soon!
Submit Your Answer
We prioritize human answers over AI answers.
If you are human, and you can answer this question, please submit your answer.