.net - What is the right way to check floating-point variables for exact value equality in c#? -


i need check if floating-point (double) variable a value equals floating-point (double) variable b value. know floating-point types don't have exact matches decimal values , such comparison not make "physical sense" still need check if values stored same binary point of view. using == operator ok in case?

if x , y both of type double, x == y if , if x , y binary-equivalent. so, if looking binary-equivalence, == want using.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -