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

◆ Dragon4Single()

static void System.Number.Dragon4Single ( float value,
int cutoffNumber,
bool isSignificantDigits,
ref NumberBuffer number )
inlinestatic

Definition at line 1312 of file Number.cs.

1313 {
1314 float num = (float.IsNegative(value) ? (0f - value) : value);
1315 int exponent;
1316 uint num2 = ExtractFractionAndBiasedExponent(value, out exponent);
1317 bool hasUnequalMargins = false;
1318 uint mantissaHighBitIdx;
1319 if (num2 >> 23 != 0)
1320 {
1321 mantissaHighBitIdx = 23u;
1322 hasUnequalMargins = num2 == 8388608;
1323 }
1324 else
1325 {
1326 mantissaHighBitIdx = (uint)BitOperations.Log2(num2);
1327 }
1328 int decimalExponent;
1329 int num3 = (int)Dragon4(num2, exponent, mantissaHighBitIdx, hasUnequalMargins, cutoffNumber, isSignificantDigits, number.Digits, out decimalExponent);
1330 number.Scale = decimalExponent + 1;
1331 number.Digits[num3] = 0;
1332 number.DigitsCount = num3;
1333 }
static ulong ExtractFractionAndBiasedExponent(double value, out int exponent)
Definition Number.cs:3510
static unsafe uint Dragon4(ulong mantissa, int exponent, uint mantissaHighBitIdx, bool hasUnequalMargins, int cutoffNumber, bool isSignificantDigits, Span< byte > buffer, out int decimalExponent)
Definition Number.cs:1335
static int Log2(uint value)

References System.Number.Dragon4(), System.Number.ExtractFractionAndBiasedExponent(), System.Numerics.BitOperations.Log2(), and System.value.

Referenced by System.Number.FormatSingle().