LeftShift - Math

From the Fallout4 CreationKit Wiki
Revision as of 17:37, 21 January 2018 by imported>Qazaaq (added required f4se version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

F4SE Member of: Math Script
Requires F4SE version 0.2.0 or higher.

Shifts value left by n number of bits.

Syntax[edit | edit source]

int Function LeftShift(int value, int shiftBy) Global Native

Parameters[edit | edit source]

  • value: The integer that you wish to shift.
  • shiftBy: How many bits to shift to the left.

Return Value[edit | edit source]

The decimal result of the shift.

Examples[edit | edit source]

int iA = Math.LeftShift(52, 5) ;iA == 1664
int iC = Math.LeftShift(0x00070, 1) ;iC == 224

See Also[edit | edit source]