Jump to content

Bitwise operations: Difference between revisions

→‎{{header|J}}: Fixed damage inadvertantly done to examples.
(→‎{{header|J}}: Segregated bitwise and rotation/shift functions. Simplified verb 'combine'.)
(→‎{{header|J}}: Fixed damage inadvertantly done to examples.)
Line 224:
f=: (32#2)&#: { '.x'"_
Examples of execution, with output:
255_255 bwo 5 NB. numeric output of bitwise operations
51 255_251 250_252 _256254
255_255 brs 5 NB. numeric output of boolean rotation and shift operations
_8160 134217720 _8 _8129 268435448
8160 7 7 8160 _134217721
255_255 boolf 5 NB. formatted text with English titling
Bitwise x AND y: 51
Bitwise x OR y: 255_251
Bitwise x XOR y: 250_252
Bitwise NOT-x: _256254
Left shift: 8160_8160
Right shift: 7134217720
Right signed shift: 7_8
Left rotate: 8160_8129
Right rotate: _134217721268435448
f _255 (bwo, brs) 5 NB. 32-bit diagrams
...............................x
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.