bit-shift-right

cur-val shift-amount


Summary

Shift all the bits in cur-val to the right by shift-amount

Arguments

cur-val
The integer val whose bits we want to shift
shift-amount
The amount of digits we want to shift the value by

Return value

A shifted integer

Examples

(bit-shift-right 16 0)
16

(bit-shift-right 16 4)
1

(bit-shift-right 16 8)
0

Bytecode

Probably only interesting to you if you want to understand more about the Nujel VM or care very much about performance.

(    0 ($get/val 'bit-shift-left))
(    2 ($get/val 'cur-val))
(    4 ($get/val '-))
(    6 ($get/val 'shift-amount))
(    8 ($apply 1))
(   10 ($apply 2))
(   12 ($ret))