Answer the question
In order to leave comments, you need to log in
Double does not output 0, how to fix?
This is what 0 looks like ( 1.58871e-10)
Answer the question
In order to leave comments, you need to log in
What makes you think it's zero? This is exactly 1.58871 * 10 -10
Arithmetic operations with real numbers on a computer are performed with a certain error, and this is exactly how it manifests itself.
No way. For real numbers, the value 0 does not exist.
To work with real numbers, it is necessary to introduce the concept of error. then
e = 0.0000001;
........................
if Abs(A - B) < e then ............
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question