Albedo

Joined 24 August 2022
m
Line 274:
2X/= : divide n by 2 and duplicate the result
1X!>#: is the result >0? (is n>=2?) It is, thus rotate the pointer by 1 (downwards, continue at l2) and go through the loop
l2: 2X1X@: move the result down (needed for further processing), and move n to the top of the stack
2X% : n mod 2 (remainder, last binary digit)
2X1X@: move binary digit down, move result of division up
loop is finished, back to the beginning (l1)
l2l1: = : duplicate result of division
2X/= : divide n by 2 and duplicate the result
1X!>#: is the result >0? (is n>=2?) It is not, thus don’t rotate the pointer and move on (totowards l3)
? : pop division result from the stack
l3: N : output first bit: 1 (1*2^1)
136

edits