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

◆ ScaleB()

static float System.MathF.ScaleB ( float x,
int n )
inlinestatic

Definition at line 419 of file MathF.cs.

420 {
421 float num = x;
422 if (n > 127)
423 {
424 num *= 1.7014118E+38f;
425 n -= 127;
426 if (n > 127)
427 {
428 num *= 1.7014118E+38f;
429 n -= 127;
430 if (n > 127)
431 {
432 n = 127;
433 }
434 }
435 }
436 else if (n < -126)
437 {
438 num *= 1.9721523E-31f;
439 n += 102;
440 if (n < -126)
441 {
442 num *= 1.9721523E-31f;
443 n += 102;
444 if (n < -126)
445 {
446 n = -126;
447 }
448 }
449 }
450 float num2 = BitConverter.Int32BitsToSingle(127 + n << 23);
451 return num * num2;
452 }

References System.BitConverter.Int32BitsToSingle().

Referenced by System.Single.ScaleB< TInteger >(), and System.Half.ScaleB< TInteger >().