September 2017 Update
This commit is contained in:
parent
bba7bfd280
commit
ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions
25
Task/Bitwise-operations/Beeswax/bitwise-operations-1.beeswax
Normal file
25
Task/Bitwise-operations/Beeswax/bitwise-operations-1.beeswax
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#eX~T~T_#
|
||||
###>N{` AND `~{~` = `&{Nz1~3J
|
||||
UXe#
|
||||
##>{` OR `~{~` = `|{Nz1~5J
|
||||
UXe#
|
||||
##>{` XOR `~{~` = `${Nz1~7J
|
||||
UXe#
|
||||
##>`NOT `{` = `!{Nz1~9J
|
||||
UXe#
|
||||
##>{` << `~{~` = `({Nz1~9PPJ
|
||||
UXe#
|
||||
##>{` >>> `~{~` = `){` (logical shift right)`N7F+M~1~J
|
||||
UXe#
|
||||
##>{` ROL `~{~` = `[{N7F+P~1~J
|
||||
UXe#
|
||||
##>{` ROR `~{~` = `]{NN8F+P~1~J
|
||||
UXe#
|
||||
##>`Arithmetic shift right is not originally implemented in beeswax.`N q
|
||||
qN`,noitagen yb dezilaer eb nac srebmun evitagen rof RSA ,yllacinhcet tuB`N<
|
||||
##>`logical shift right, and negating the result again:`NN7F++~1~J
|
||||
UXe# #>e#
|
||||
#>~1~[&'pUX{` >> `~{~` = `){` , interpreted as (positive) signed Int64 number (MSB=0), equivalent to >>>`NN;
|
||||
###
|
||||
>UX`-`!P{M!` >> `~{~` = `!)!`-`M!{` , interpreted as (negative) signed Int64 number (MSB=1)`NN;
|
||||
#>e#
|
||||
19
Task/Bitwise-operations/Beeswax/bitwise-operations-2.beeswax
Normal file
19
Task/Bitwise-operations/Beeswax/bitwise-operations-2.beeswax
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
julia> beeswax("Bitops.bswx",0,0.0,Int(20000))
|
||||
i9223653511831486512
|
||||
i48
|
||||
|
||||
9223653511831486512 AND 48 = 48
|
||||
9223653511831486512 OR 48 = 9223653511831486512
|
||||
9223653511831486512 XOR 48 = 9223653511831486464
|
||||
NOT 9223653511831486512 = 9223090561878065103
|
||||
9223653511831486512 << 48 = 13510798882111488
|
||||
9223653511831486512 >>> 48 = 32769 (logical shift right)
|
||||
9223653511831486512 ROL 48 = 13651540665434112
|
||||
9223653511831486512 ROR 48 = 3178497
|
||||
|
||||
Arithmetic shift right is not originally implemented in beeswax.
|
||||
|
||||
But technically, ASR for negative numbers can be realized by negation,
|
||||
logical shift right, and negating the result again:
|
||||
|
||||
-9223090561878065104 >> 48 = -32767 , interpreted as (negative) signed Int64 number (MSB=1)
|
||||
|
|
@ -0,0 +1 @@
|
|||
A>>B = NOT(NOT(A)>>>B)
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
A ROL B = A<<(B%64)+A>>>(64-B%64)
|
||||
A ROR B = A>>>(B%64)+A<<(64-B%64)
|
||||
Loading…
Add table
Add a link
Reference in a new issue