Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deleted #18

Closed
khoroshevj opened this issue Oct 2, 2015 · 0 comments
Closed

deleted #18

khoroshevj opened this issue Oct 2, 2015 · 0 comments

Comments

@khoroshevj
Copy link

var first = 25000000000.000000000000m;
var second = 25000000000m;
Console.WriteLine(first.Equals(second)); //true
Console.WriteLine(first.GetHashCode() == second.GetHashCode()); //false 

first =  25000000001.000000000000m;
second = 25000000001m;
Console.WriteLine(first.Equals(second)); //true
Console.WriteLine(first.GetHashCode() == second.GetHashCode()); //true 

first =  25000000000.100000000000m;
second = 25000000000.1m;
Console.WriteLine(first.Equals(second)); //true
Console.WriteLine(first.GetHashCode() == second.GetHashCode()); //true  

return false only if precision of one of values is 12 and the precision contains only trailing zeros and significant part is the 25 000 000 000 ^ (2 * n)

@khoroshevj khoroshevj changed the title decimal GetHashCode() returns different values, but Equals is true deleted Oct 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant