Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ NumberToDouble()

static double System.Number.NumberToDouble ( ref NumberBuffer number)
inlinestaticpackage

Definition at line 5949 of file Number.cs.

5950 {
5951 double num;
5952 if (number.DigitsCount == 0 || number.Scale < -324)
5953 {
5954 num = 0.0;
5955 }
5956 else if (number.Scale > 309)
5957 {
5958 num = double.PositiveInfinity;
5959 }
5960 else
5961 {
5962 ulong value = NumberToDoubleFloatingPointBits(ref number, in FloatingPointInfo.Double);
5963 num = BitConverter.UInt64BitsToDouble(value);
5964 }
5965 if (!number.IsNegative)
5966 {
5967 return num;
5968 }
5969 return 0.0 - num;
5970 }
static unsafe ulong NumberToDoubleFloatingPointBits(ref NumberBuffer number, in FloatingPointInfo info)
Definition Number.cs:3693

References System.Number.FloatingPointInfo.Double, System.Number.NumberToDoubleFloatingPointBits(), System.BitConverter.UInt64BitsToDouble(), and System.value.

Referenced by System.Buffers.Text.Utf8Parser.TryParse(), and System.Number.TryParseDouble().