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

◆ GetDoubleParts()

static void System.Numerics.NumericsHelpers.GetDoubleParts ( double dbl,
out int sign,
out int exp,
out ulong man,
out bool fFinite )
inlinestatic

Definition at line 7 of file NumericsHelpers.cs.

8 {
9 Unsafe.SkipInit(out DoubleUlong doubleUlong);
10 doubleUlong.uu = 0uL;
11 doubleUlong.dbl = dbl;
12 sign = 1 - ((int)(doubleUlong.uu >> 62) & 2);
13 man = doubleUlong.uu & 0xFFFFFFFFFFFFFuL;
14 exp = (int)(doubleUlong.uu >> 52) & 0x7FF;
15 if (exp == 0)
16 {
17 fFinite = true;
18 if (man != 0L)
19 {
20 exp = -1074;
21 }
22 }
23 else if (exp == 2047)
24 {
25 fFinite = false;
26 exp = int.MaxValue;
27 }
28 else
29 {
30 fFinite = true;
31 man |= 4503599627370496uL;
32 exp -= 1075;
33 }
34 }

References System.L.

Referenced by System.Numerics.BigInteger.BigInteger().