Spatial4n.Core.Shapes.Impl.GeoCircle.Ulp C# (CSharp) Method

Ulp() private static method

private static Ulp ( double value ) : double
value double
return double
        private static double Ulp(double value)
        {
            if (Double.IsNaN(value)) return Double.NaN;
            if (Double.IsInfinity(value)) return Double.PositiveInfinity;
            if (value == +0.0d || value == -0.0d) return Double.MinValue;
            if (value == Double.MaxValue) return Math.Pow(2, 971);

            long bits = BitConverter.DoubleToInt64Bits(value);
            double nextValue = BitConverter.Int64BitsToDouble(bits + 1);
            return nextValue - value;
        }