mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Made hashing better
This commit is contained in:
parent
63c6421413
commit
f3e9224a45
1 changed files with 2 additions and 11 deletions
|
@ -41,17 +41,8 @@ namespace System
|
||||||
// Ensure that 0 and -0 have the same hash code
|
// Ensure that 0 and -0 have the same hash code
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
return *((int*)&d) ^ ((int32*)&d)[1];
|
||||||
|
|
||||||
if (sizeof(int) == sizeof(double))
|
|
||||||
{
|
|
||||||
var val = (double)this;
|
|
||||||
return *(int*)(&val);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int64 value = *(int64*)(&d);
|
|
||||||
return ((int32)value) ^ ((int32)(value >> 32));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool IsInfinity
|
public bool IsInfinity
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue