using System.Runtime.InteropServices;
using System.Globalization;
namespace System
{
[StructLayout(LayoutKind.Sequential), Serializable,ComVisible(true)]
public struct Double : System.IComparable, System.IFormattable, System.IConvertible, System.IComparable<double>, System.IEquatable<double>
{
public const double MinValue = -1.7976931348623157e+308;
public const double MaxValue = 1.7976931348623157e+308;
public const double Epsilon = 4.9406564584124654e-324;
public const double NegativeInfinity = System.BitConverter.ToDouble(System.BitConverter.GetBytes(0xFFF0000000000000),0);
public const double PositiveInfinity = System.BitConverter.ToDouble(System.BitConverter.GetBytes(0x7FF0000000000000),0);
public const double NaN = System.BitConverter.ToDouble(System.BitConverter.GetBytes(0xFFF8000000000000),0);
internal double m_value;
static internal double NegativeZero;
public static bool IsInfinity(double d)
{
//.maxstack 8
//IL_0000: ldarga.s d
//IL_0002: conv.u
//IL_0003: ldind.i8
//IL_0004: ldc.i8 0x7fffffffffffffff
//IL_000d: and
//IL_000e: ldc.i8 0x7ff0000000000000
//IL_0017: ceq
//IL_0019: ret
return *((long*)&d)& 0x7fffffffffffffff ==0x7ff0000000000000;
}
public static bool IsPositiveInfinity(double d)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldc.r8 (00 00 00 00 00 00 F0 7F)
//IL_000a: bne.un.s IL_000e
//IL_000c: ldc.i4.1
//IL_000d: ret
//IL_000e: ldc.i4.0
//IL_000f: ret
if (d != float.PositiveInfinity)
{
return false;
}
else
{
return true;
}
}
public static bool IsNegativeInfinity(double d)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldc.r8 (00 00 00 00 00 00 F0 FF)
//IL_000a: bne.un.s IL_000e
//IL_000c: ldc.i4.1
//IL_000d: ret
//IL_000e: ldc.i4.0
//IL_000f: ret
if (d != float.NegativeInfinity)
{
return false;
}
else
{
return true;
}
}
internal static bool IsNegative(double d)
{
//.maxstack 8
//IL_0000: ldarga.s d
//IL_0002: conv.u
//IL_0003: ldind.i8
//IL_0004: ldc.i8 0x8000000000000000
//IL_000d: and
//IL_000e: ldc.i8 0x8000000000000000
//IL_0017: ceq
//IL_0019: ret
return (*((ulong*)&d) & 0x8000000000000000) == 0x8000000000000000;
}
[System.Runtime.ConstrainedExecution.ReliabilityContractAttribute(System.Runtime.ConstrainedExecution.Consistency.WillNotCorruptState, System.Runtime.ConstrainedExecution.Cer.Success)]
public static bool IsNaN(double d)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldarg.0
//IL_0002: beq.s IL_0006
//IL_0004: ldc.i4.1
//IL_0005: ret
//IL_0006: ldc.i4.0
//IL_0007: ret
if (d == d)
{
return false;
}
else
{
return true;
}
}
public new virtual sealed int CompareTo(object @value)
{
//.maxstack 2
//.locals init (float64 V_0)
//IL_0000: ldarg.1
//IL_0001: brtrue.s IL_0005
//IL_0003: ldc.i4.1
//IL_0004: ret
//IL_0005: ldarg.1
//IL_0006: isinst System.Double
//IL_000b: brfalse.s IL_0040
//IL_000d: ldarg.1
//IL_000e: unbox.any System.Double
//IL_0013: stloc.0
//IL_0014: ldarg.0
//IL_0015: ldind.r8
//IL_0016: ldloc.0
//IL_0017: bge.un.s IL_001b
//IL_0019: ldc.i4.m1
//IL_001a: ret
//IL_001b: ldarg.0
//IL_001c: ldind.r8
//IL_001d: ldloc.0
//IL_001e: ble.un.s IL_0022
//IL_0020: ldc.i4.1
//IL_0021: ret
//IL_0022: ldarg.0
//IL_0023: ldind.r8
//IL_0024: ldloc.0
//IL_0025: bne.un.s IL_0029
//IL_0027: ldc.i4.0
//IL_0028: ret
//IL_0029: ldarg.0
//IL_002a: ldind.r8
//IL_002b: call bool System.Double::IsNaN(float64)
//IL_0030: brfalse.s IL_003e
//IL_0032: ldloc.0
//IL_0033: call bool System.Double::IsNaN(float64)
//IL_0038: brtrue.s IL_003c
//IL_003a: ldc.i4.m1
//IL_003b: ret
//IL_003c: ldc.i4.0
//IL_003d: ret
//IL_003e: ldc.i4.1
//IL_003f: ret
//IL_0040: ldstr "Arg_MustBeDouble"
//IL_0045: call string System.Environment::GetResourceString(string)
//IL_004a: newobj instance void System.ArgumentException::.ctor(string)
//IL_004f: throw
double V_0;
if (@value == null)
{
return 1;
}
else
{
if (@value as double == null)
{
//IL_0040
throw new System.ArgumentException(System.Environment.GetResourceString("Arg_MustBeDouble"));
}
else
{
//IL_000d
V_0 = (double)@value;
if (this >= V_0)
{
if (this <= V_0)
{
//IL_0022
if (this != V_0)
{
//IL_0029
if (double.IsNaN(this))
{
if (double.IsNaN(V_0))
{
return 0;
}
else
{
return -1;
}
}
else
{
return 1;
}
}
else
{
return 0;
}
}
else
{
return 1;
}
}
else
{
return -1;
}
}
}
}
public new virtual sealed int CompareTo(double @value)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ldarg.1
//IL_0003: bge.un.s IL_0007
//IL_0005: ldc.i4.m1
//IL_0006: ret
//IL_0007: ldarg.0
//IL_0008: ldind.r8
//IL_0009: ldarg.1
//IL_000a: ble.un.s IL_000e
//IL_000c: ldc.i4.1
//IL_000d: ret
//IL_000e: ldarg.0
//IL_000f: ldid.r8
//IL_0010: ldarg.1
//IL_0011: bne.un.s IL_0015
//IL_0013: ldc.i4.0
//IL_0014: ret
//IL_0015: ldarg.0
//IL_0016: ldind.r8
//IL_0017: call bool System.Double::IsNaN(float64)
//IL_001c: brfalse.s IL_002a
//IL_001e: ldarg.1
//IL_001f: call bool System.Double::IsNaN(float64)
//IL_0024: brtrue.s IL_0028
//IL_0026: ldc.i4.m1
//IL_0027: ret
//IL_0028: ldc.i4.0
//IL_0029: ret
//IL_002a: ldc.i4.1
//IL_002b: ret
if (this >= @value)
{
if (this <= @value)
{
if (this != @value)
{
//IL_0015
if (double.IsNaN(this))
{
if (double.IsNaN(@value))
{
return 0;
}
else
{
return -1;
}
}
else
{
return 1;
}
}
else
{
return 0;
}
}
else
{
return 1;
}
}
else
{
return -1;
}
}
public virtual bool Equals(object obj)
{
//.maxstack 2
//.locals init (float64 V_0)
//IL_0000: ldarg.1
//IL_0001: isinst System.Double
//IL_0006: brtrue.s IL_000a
//IL_0008: ldc.i4.0
//IL_0009: ret
//IL_000a: ldarg.1
//IL_000b: unbox.any System.Double
//IL_0010: stloc.0
//IL_0011: ldloc.0
//IL_0012: ldarg.0
//IL_0013: ldind.r8
//IL_0014: bne.un.s IL_0018
//IL_0016: ldc.i4.1
//IL_0017: ret
//IL_0018: ldloc.0
//IL_0019: call bool System.Double::IsNaN(float64)
//IL_001e: brfalse.s IL_0028
//IL_0020: ldarg.0
//IL_0021: ldind.r8
//IL_0022: call bool System.Double::IsNaN(float64)
//IL_0027: ret
//IL_0028: ldc.i4.0
//IL_0029: ret
double V_0;
if (obj as double == null)
{
return false;
}
else
{
V_0 = (double)obj;
if (V_0 != this)
{
if (double.IsNaN(V_0))
{
return double.IsNaN(this);
}
else
{
return false;
}
}
else { return true; }
}
}
public new virtual sealed bool Equals(double obj)
{
//.maxstack 8
//IL_0000: ldarg.1
//IL_0001: ldarg.0
//IL_0002: ldind.r8
//IL_0003: bne.un.s IL_0007
//IL_0005: ldc.i4.1
//IL_0006: ret
//IL_0007: ldarg.1
//IL_0008: call bool System.Double::IsNaN(float64)
//IL_000d: brfalse.s IL_0017
//IL_000f: ldarg.0
//IL_0010: ldind.r8
//IL_0011: call bool System.Double::IsNaN(float64)
//IL_0016: ret
//IL_0017: ldc.i4.0
//IL_0018: ret
if (obj != this)
{
if (ouble.IsNaN(obj))
{
return double.IsNaN(this);
}
else
{
return false;
}
}
else
{
return true;
}
}
public virtual int GetHashCode()
{
//.maxstack 3
//.locals init (float64 V_0,
//int64 V_1)
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: stloc.0
//IL_0003: ldloc.0
//IL_0004: ldc.r8 0.0
//IL_000d: bne.un.s IL_0011
//IL_000f: ldc.i4.0
//IL_0010: ret
//IL_0011: ldloca.s V_0
//IL_0013: conv.u
//IL_0014: ldind.i8
//IL_0015: stloc.1
//IL_0016: ldloc.1
//IL_0017: conv.i4
//IL_0018: ldloc.1
//IL_0019: ldc.i4.s 32
//IL_001b: shr
//IL_001c: conv.i4
//IL_001d: xor
//IL_001e: ret
double V_0;
long V_1;
V_0 = this;
if (V_0 != 0.0d)
{
V_1=*((long*)&V_0);
return (int)V_1 ^ (int)(V_1>>32);
}
else
{
return 0;
}
}
public virtual string ToString()
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ldnull
//IL_0003: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo()
//IL_0008: call string System.Number::FormatDouble(float64,
//string,
//class System.Globalization.NumberFormatInfo)
//IL_000d: ret
return System.Number.FormatDouble(this,null,NumberFormatInfo.CurrentInfo);
}
public string ToString(string format)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ldarg.1
//IL_0003: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo()
//IL_0008: call string System.Number::FormatDouble(float64,
//string,
//class System.Globalization.NumberFormatInfo)
//IL_000d: ret
return System.Number.FormatDouble(this, format, NumberFormatInfo.CurrentInfo);
}
public new virtual sealed string ToString(System.IFormatProvider provider)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ldnull
//IL_0003: ldarg.1
//IL_0004: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(class System.IFormatProvider)
//IL_0009: call string System.Number::FormatDouble(float64,
//string,
//class System.Globalization.NumberFormatInfo)
//IL_000e: ret
return System.Number.FormatDouble(this, null, NumberFormatInfo.GetInstance(provider));
}
public new virtual sealed string ToString(string format, System.IFormatProvider provider)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ldarg.1
//IL_0003: ldarg.2
//IL_0004: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(class System.IFormatProvider)
//IL_0009: call string System.Number::FormatDouble(float64,
//string,
//class System.Globalization.NumberFormatInfo)
//IL_000e: ret
return System.Number.FormatDouble(this, format, NumberFormatInfo.etInstance(provider));
}
public static double Parse(string s)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldc.i4 0xe7
//IL_0006: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo()
//IL_000b: call float64 System.Double::Parse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo)
//IL_0010: ret
return System.Double.Parse(s, NumberStyles.AllowThousands | NumberStyles.Float,NumberFormatInfo.CurrentInfo);
}
public static double Parse(string s, System.Globalization.NumberStyles style)
{
//.maxstack 8
//IL_0000: ldarg.1
//IL_0001: call void System.Globalization.NumberFormatInfo::ValidateParseStyleFloatingPoint(valuetype System.Globalization.NumberStyles)
//IL_0006: ldarg.0
//IL_0007: ldarg.1
//IL_0008: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo()
//IL_000d: call float64 System.Double::Parse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo)
//IL_0012: ret
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return System.Double.Parse(s, style, NumberFormatInfo.CurrentInfo);
}
public static double Parse(string s, System.IFormatProvider provider)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldc.i4 0xe7
//IL_0006: ldarg.1
//IL_0007: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(class System.IFormatProvider)
//IL_000c: call float64 System.Double::Parse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo)
//IL_0011: ret
return System.Double.Parse(s, NumberStyles.AllowThousands | NumberStyles.Float, NumberFormatInfo.GetInstance(provider));
}
public static double Parse(string s, System.Globalization.NumberStyles style, System.IFormatProvider provider)
{
//.maxstack 8
//IL_0000: ldarg.1
//IL_0001: call void System.Globalization.NumberFormatInfo::ValidateParseStyleFloatingPoint(valuetype System.Globalization.NumberStyles)
//IL_0006: ldarg.0
//IL_0007: ldarg.1
//IL_0008: ldarg.2
//IL_0009: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(class System.IFormatProvider)
//IL_000e: call float64 System.Double::Parse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo)
//IL_0013: ret
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return System.Double.Parse(s, style, NumberFormatInfo.GetInstance(provider));
}
private static double Parse(string s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info)
{
//.maxstack 3
//.locals init (string V_0,
//float64 V_1)
//.try
//{
//IL_0000: ldarg.0
//IL_0001: ldarg.1
//IL_0002: ldarg.2
//IL_0003: call float64 System.Number::ParseDouble(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo)
//IL_0008: stloc.1
//IL_0009: leave.s IL_0063
//}
//catch System.FormatException
//{
//IL_00b: pop
//IL_000c: ldarg.0
//IL_000d: callvirt instance string System.String::Trim()
//IL_0012: stloc.0
//IL_0013: ldloc.0
//IL_0014: ldarg.2
//IL_0015: callvirt instance string System.Globalization.NumberFormatInfo::get_PositiveInfinitySymbol()
//IL_001a: callvirt instance bool System.String::Equals(string)
//IL_001f: brfalse.s IL_002d
//IL_0021: ldc.r8 (00 00 00 00 00 00 F0 7F)
//IL_002a: stloc.1
//IL_002b: leave.s IL_0063
//IL_002d: ldloc.0
//IL_002e: ldarg.2
//IL_002f: callvirt instance string System.Globalization.NumberFormatInfo::get_NegativeInfinitySymbol()
//IL_0034: callvirt instance bool System.String::Equals(string)
//IL_0039: brfalse.s IL_0047
//IL_003b: ldc.r8 (00 00 00 00 00 00 F0 FF)
//IL_0044: stloc.1
//IL_0045: leave.s IL_0063
//IL_0047: ldloc.0
//IL_0048: ldarg.2
//IL_0049: callvirt instance string System.Globalization.NumberFormatInfo::get_NaNSymbol()
//IL_004e: callvirt instance bool System.String::Equals(string)
//IL_0053: brfalse.s IL_0061
//IL_0055: ldc.r8 (00 00 00 00 00 00 F8 FF)
//IL_005e: stloc.1
//IL_005f: leave.s IL_0063
//IL_0061: rethrow
//}
//IL_0063: ldloc.1
//IL_0064: ret
string V_0;
double V_1;
try
{
V_1 = System.Number.ParseDouble(s, style, info);
}
catch (System.FormatException)
{
//IL_000b:
V_0 = s.Trim();
if (V_0.Equals(info.PositiveInfinitySymbol))
{
V_1 = double.PositiveInfinity;
}
else
{
//IL_0029
if (V_0.Equals(info.NegativeInfinitySymbol))
{
V_1 = double.NegativeInfinity;
}
else
{
if (V_0.Equals(info.NaNSymbol))
{
V_1 = double.NaN;
}
else
{
throw;
}
}
}
}
return V_1;
}
public static bool TryParse(string s, out double result)
{
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldc.i4 0xe7
//IL_0006: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::get_CurrentInfo()
//IL_000b: ldarg.1
//IL_000c: call bool System.Double::TryParse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo,
//float64&)
//IL_0011: ret
return System.Double.TryParse(s, NumberStyles.AllowThousands | NumberStyles.Float, NumberFormatInfo.CurrentInfo, out result);
}
public static bool TryParse(string s, System.Globalization.NumberStyles style, System.IFormatProvider provider, out double result)
{
//.maxstack 8
//IL_0000: ldarg.1
//IL_0001: call void System.Globalization.NumberFormatInfo::ValidateParseStyleFloatingPoint(valuetype System.Globalization.NumberStyles)
//IL_0006: ldarg.0
//IL_0007: ldarg.1
//IL_0008: ldarg.2
//IL_0009: call class System.Globalization.NumberFormatInfo System.Globalization.NumberFormatInfo::GetInstance(class System.IFormatProvider)
//IL_000e: larg.3
//IL_000f: call bool System.Double::TryParse(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo,
//float64&)
//IL_0014: ret
NumberFormatInfo.ValidateParseStyleFloatingPoint(style);
return System.Double.TryParse(s, style, NumberFormatInfo.GetInstance(provider), out result);
}
private static bool TryParse(string s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info, out double result)
{
//.maxstack 4
//.locals init (bool V_0,
//string V_1)
//IL_0000: ldarg.0
//IL_0001: brtrue.s IL_0010
//IL_0003: ldarg.3
//IL_0004: ldc.r8 0.0
//IL_000d: stind.r8
//IL_000e: ldc.i4.0
//IL_000f: ret
//IL_0010: ldarg.0
//IL_0011: ldarg.1
//IL_0012: ldarg.2
//IL_0013: ldarg.3
//IL_0014: call bool System.Number::TryParseDouble(string,
//valuetype System.Globalization.NumberStyles,
//class System.Globalization.NumberFormatInfo,
//float64&)
//IL_0019: stloc.0
//IL_001a: ldloc.0
//IL_001b: brtrue.s IL_0077
//IL_001d: ldarg.0
//IL_001e: callvirt instance string System.String::Trim()
//IL_0023: stloc.1
//IL_0024: ldloc.1
//IL_0025: ldarg.2
//IL_0026: callvirt instance string System.Globalization.NumberFormatInfo::get_PositiveInfinitySymbol()
//IL_002b: callvirt instance bool System.String::Equals(string)
//IL_0030: brfalse.s IL_003f
//IL_0032: ldarg.3
//IL_0033: ldc.r8 (00 00 00 00 00 00 F0 7F)
//IL_003c: stind.r8
//IL_003d: br.s IL_0077
//IL_003f: ldloc.1
//IL_0040: ldarg.2
//IL_0041: callvirt instance string System.Globalization.NumberFormatInfo::get_NegativeInfinitySymbol()
//IL_0046: callvirt instance bool System.String::Equals(string)
//IL_004b: brfalse.s IL_005a
//IL_004d: ldarg.3
//IL_004e: ldc.r8 (00 00 00 00 00 00 F0 FF)
//IL_0057: stind.r8
//IL_0058: br.s IL_0077
//IL_005a: ldloc.1
//IL_005b: ldarg.2
//IL_005c: callvirt instance string System.Globalization.NumberFormatInfo::get_NaNSymbol()
//IL_0061: callvirt instance bool System.String::Equals(string)
//IL_0066: brfalse.s IL_0075
//IL_0068: ldarg.3
//IL_0069: ldc.r8 (00 00 00 00 00 00 F8 FF)
//IL_0072: stind.r8
//IL_0073: br.s IL_0077
//IL_0075: ldc.i4.0
//IL_0076: ret
//IL_0077: ldc.i4.1
//IL_0078: ret
bool V_0;
string V_1;
if (s == null)
{
result = 0.0d;
return false;
}
else
{
V_0 = System.Number.TryParseDouble(s, style, info, out result);
if (V_0)
{
return true;
}
else
{
//IL_0019
V_1 = s.Trim();
if (V_1.Equals(info.PositiveInfinitySymbol))
{
result = double.PositiveInfinity;
}
else if (V_1.Equals(info.NegativeInfinitySymbol))
{
result = double.NegativeInfinity;
}
else if (V_1.Equals(info.NaNSymbol))
{
result = double.NaN;
}
else
{
return false;
}
return true;
}
}
}
public new virtual sealed System.TypeCode GetTypeCode()
{
//.maxstack 8
//IL_0000: ldc.i4.s 14
//IL_0002: ret
return TypeCode.Double;
}
private new virtual sealed bool System.IConvertible.ToBoolean(System.IFormatProvider provider)
{
//.override System.IConvertible::ToBoolean
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call bool System.Convert::ToBoolean(float64)
//IL_0007: ret
return System.Convert.ToBoolean(this);
}
private new virtual sealed char System.IConvertible.ToChar(System.IFormatProvider provider)
{
//.override System.IConvertible::ToChar
//.maxstack 5
//.locals init (object[] V_0)
//IL_0000: call class System.Globalization.CultureInfo System.Globalization.CultureInfo::get_CurrentCulture()
//IL_0005: ldstr "InvalidCast_FromTo"
//IL_000a: call string System.Environment::GetResourceString(string)
//IL_000f: ldc.i4.2
//IL_0010: newarr System.Object
//IL_0015: stloc.0
//IL_0016: ldloc.0
//IL_0017: ldc.i4.0
//IL_0018: ldstr "Double"
//IL_001d: stelem.ref
//IL_001e: ldloc.0
//IL_001f: ldc.i4.1
//IL_0020: ldstr "Char"
//IL_0025: stelem.ref
//IL_0026: ldloc.0
//IL_0027: call string System.String::Format(class System.IFormatProvider,
//string,
//object[])
//IL_002c: newobj instance void System.InvalidCastException::.ctor(string)
//IL_0031: throw
object[] V_0;
V_0 = new object[2];
V_0[0] = "Double";
V_0[1] = "Char";
throw new System.InvalidCastException(string.Format(CultureInfo.CurrentCulture, System.Environment.GetResourceString("InvalidCast_FromTo"), V_0));
}
private new virtual sealed sbyte System.IConvertible.ToSByte(System.IFormatProvider provider)
{
//.override System.IConvertible::ToSByte
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call int8 System.Convert::ToSByte(float64)
//IL_0007: ret
return System.Convert.ToSByte(this);
}
private new virtual sealed byte System.IConvertible.ToByte(System.IFormatProvider provider)
{
//.override System.IConvertible::ToByte
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call uint8 System.Convert::ToByte(float64)
//IL_0007: ret
return System.Convert.ToByte(this);
}
private new virtual sealed short System.IConvertible.ToInt16(System.IFormatProvider provider)
{
//.override System.IConvertible::ToInt16
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call int16 System.Convert::ToInt16(float64)
//IL_0007: ret
return System.Convert.ToInt16(this);
}
private new virtual sealed ushort System.IConvertible.ToUInt16(System.IFormatProvider provider)
{
//.override System.IConvertible::ToUInt16
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call uint16 System.Convert::ToUInt16(float64)
//IL_0007: ret
return System.Convert.ToUInt16(this);
}
privat new virtual sealed int System.IConvertible.ToInt32(System.IFormatProvider provider)
{
//.override System.IConvertible::ToInt32
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call int32 System.Convert::ToInt32(float64)
//IL_0007: ret
return System.Convert.ToInt32(this);
}
private new virtual sealed uint System.IConvertible.ToUInt32(System.IFormatProvider provider)
{
//.override System.IConvertible::ToUInt32
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call uint32 System.Convert::ToUInt32(float64)
//IL_0007: ret
return System.Convert.ToUInt32(this);
}
private new virtual sealed long System.IConvertible.ToInt64(System.IFormatProvider provider)
{
//.override System.IConvertible::ToInt64
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call int64 System.Convert::ToInt64(float64)
//IL_0007: ret
return System.Convert.ToInt64(this);
}
private new virtual sealed ulong System.IConvertible.ToUInt64(System.IFormatProvider provider)
{
//.override System.IConvertible::ToUInt64
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call uint64 System.Convert::ToUInt64(float64)
//IL_0007: ret
return System.Convert.ToUInt64(this);
}
private new virtual sealed float System.IConvertible.ToSingle(System.IFormatProvider provider)
{
//.override System.IConvertible::ToSingle
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call float32 System.Convert::ToSingle(float64)
//IL_0007: ret
return System.Convert.ToSingle(this);
}
private new virtual sealed double System.IConvertible.ToDouble(System.IFormatProvider provider)
{
//.override System.IConvertible::ToDouble
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: ret
return this;
}
private new virtual sealed System.Decimal System.IConvertible.ToDecimal(System.IFormatProvider provider)
{
//.override System.IConvertible::ToDecimal
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: call valuetype System.Decimal System.Convert::ToDecimal(float64)
//IL_0007: ret
return System.Convert.ToDecimal(this);
}
private new virtual sealed System.DateTime System.IConvertible.ToDateTime(System.IFormatProvider provider)
{
//.override System.IConvertible::ToDateTime
//.maxstack 5
//.locals init (object[] V_0)
//IL_0000: call class System.Globalization.CultureInfo System.Globalization.CultureInfo::get_CurrentCulture()
//IL_0005: ldstr "InvalidCast_FromTo"
//IL_000a: call string System.Environment::GetResourceString(string)
//IL_000f: ldc.i4.2
//IL_0010: newarr System.Object
//IL_0015: stloc.0
//IL_0016: ldloc.0
//IL_0017: ldc.i4.0
//IL_0018: ldstr "Double"
//IL_001d: stelem.ref
//IL_001e: ldloc.0
//IL_001f: ldc.i4.1
//IL_0020: ldstr "DateTime"
//IL_0025: stelem.ref
//IL_0026: ldloc.0
//IL_0027: call string System.String::Format(class System.IFormatProvider,
//string,
//object[])
//IL_002c: newobj insance void System.InvalidCastException::.ctor(string)
//IL_0031: throw
object[] V_0;
V_0 = new object[2];
V_0[0] = "Double";
V_0[1] = "DateTime";
throw new System.InvalidCastException(string.Format(CultureInfo.CurrentCulture, System.Environment.GetResourceString("InvalidCast_FromTo"), V_0));
}
private new virtual sealed object System.IConvertible.ToType(System.Type @type, System.IFormatProvider provider)
{
//.override System.IConvertible::ToType
//.maxstack 8
//IL_0000: ldarg.0
//IL_0001: ldind.r8
//IL_0002: box System.Double
//IL_0007: ldarg.1
//IL_0008: ldarg.2
//IL_0009: call object System.Convert::DefaultToType(class System.IConvertible,
//class System.Type,
//class System.IFormatProvider)
//IL_000e: ret
return System.Convert.DefaultToType((System.IConvertible)this, @type, provider);
}
private static Double()
{
//.maxstack 8
//IL_0000: ldc.i8 0x8000000000000000
//IL_0009: call float64 System.BitConverter::Int64BitsToDouble(int64)
//IL_000e: stsfld float64 System.Double::NegativeZero
//IL_0013: ret
System.Double.NegativeZero=System.BitConverter.Int64BitsToDouble(0x8000000000000000);
}
}
}