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