Handbook
Glossary
split-widthed ( widthed n -- widthed1 widthed2 )
Vocabulary
bitstreams
.
private
Inputs
widthed
an
object
n
an
object
Outputs
widthed1
an
object
widthed2
an
object
Definition
USING:
accessors
bitstreams
kernel
math
math.bitwise
;
IN:
bitstreams.private
:
split-widthed
( widthed n -- widthed1 widthed2 )
2dup
[
#bits>>
]
dip
<
[
drop
zero-widthed
]
[
[
widthed-bits
]
[
[
[
bits>>
]
[
#bits>>
]
bi
]
dip
-
[
bits
]
keep
<widthed>
]
2bi
]
if
;