Bitwise shr right
Issue #844
resolved
W10 fully updated, v 0.12
Hi,
As installed, F6, binary output. Calculate 1/100. This give expected result. = 0b0.0000001010001111011 I wish now to "move the decimal point" six places to the right. shr(ans;6) gives compile error.
Comments (5)
-
repo owner -
repo owner BTW, shr() does not move the decimal point as you intend.
-
repo owner - changed milestone to 1.0
-
repo owner - changed status to resolved
-
We should probably add a note in the manual indicating that bitwise functions only work on integers.
As a workaround,
shr
/shl
does the same as dividing/multiplying by a power of 2, so you can move the decimal point that way (ans * 2**6
). And as @heldercorreia indicated, you should have usedshl
for what you want (but it only works on integers anyway). - Log in to comment
Current development version yields 0 instead of compile error.