/// <summary>
/// Computes a hash code for a double value, using the algorithm from
/// Joshua Bloch's book <i>Effective Java"</i>
/// </summary>
/// <param name="value">A hashcode for the double value</param>
public static int GetHashCode(double value)
{
/*
* From the java language specification, it says:
*
* The value of n>>>s is n right-shifted s bit positions with zero-extension.
* If n is positive, then the result is the same as that of n>>s; if n is
* negative, the result is equal to that of the expression (n>>s)+(2<<~s) if
* the type of the left-hand operand is int
*/
var f = BitConverter.DoubleToInt64Bits(value);
//if (f > 0)
return((int)(f ^ (f >> 32)));
//return (int) (f ^ ((f >> 32) + (2 << ~32)));
}