Difference between revisions of "RightShift - Math"

From the Fallout4 CreationKit Wiki
Jump to navigation Jump to search
imported>Qazaaq
(Added F4SE member)
 
imported>Qazaaq
(added required f4se version)
 
Line 1: Line 1:
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:F4SE]]
'''F4SE Member of:''' [[Math Script]]
'''F4SE Member of:''' [[Math Script]]
{{Template:Papyrus:RequiredF4SE|version=0.2.0}}


Shifts value right by n number of bits.
Shifts value right by n number of bits.
Line 26: Line 24:
== See Also ==
== See Also ==
*[[Math Script]]
*[[Math Script]]
[[Category:Scripting]]
[[Category:Papyrus]]
[[Category:F4SE]]

Latest revision as of 17:46, 21 January 2018

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

Shifts value right by n number of bits.

Syntax[edit | edit source]

int Function RightShift(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 right.

Return Value[edit | edit source]

The decimal result of the shift.

Examples[edit | edit source]

int iA = Math.RightShift(2146, 2) ;iA == 536
int iC = Math.RightShift(0x00802000, 9) ;iC == 16400

See Also[edit | edit source]