Check If Two Doubles Are "Sufficiently Equal"

jsurpless

Well-known member
Joined
Jul 29, 2008
Messages
144
Programming Experience
Beginner
Hi

I've got to compare two double values and the number of decimal places in each is not fixed... I'd like to compare them and say that if they're equal up to 4 decimal places, they're equivalent...

What would be the best way to do this?

Thanks!

-Justin
 
Math.Round() them to 4 decimal places.
 
Back
Top