Quantcast
Channel: Answers for "wired calculation I don't get it 30-30 = 1.907349E-06"
Viewing all articles
Browse latest Browse all 4

Answer by xt-xylophone

$
0
0
I think sometimes floats that say they are whole numbers are actually really close and not exact. It's kinda like a rounding error. In your case it's an error of only 0.000001907349 Casting won't help with this. Maybe try a rounding function before you do the maths? Or if on the future you want to check if 2 floats are equal, try checking if the difference is less than a reeeaally small number instead of ==

Viewing all articles
Browse latest Browse all 4

Latest Images

Trending Articles





Latest Images