Handbook
Glossary
h>b/b ( h -- b1 b2 )
Factor handbook
»
The language
»
Numbers
»
Arithmetic
»
Bitwise arithmetic
»
Additional bitwise arithmetic
Prev:
w>h/h ( w -- h1 h2 )
Next:
>even ( m -- n )
Vocabulary
math
.
bitwise
Inputs
h
a 16-bit integer
Outputs
b1
an 8-bit integer
b2
an 8-bit integer
Word description
Outputs two integers, the least followed by the most significant 8 bits of the input.
Definition
USING:
kernel
math
;
IN:
math.bitwise
:
h>b/b
( h -- b1 b2 )
[
255
bitand
]
[
-8
shift
255
bitand
]
bi
;