Handbook
Glossary
check-widthed ( bits #bits -- bits #bits )
Vocabulary
bitstreams
Inputs
bits
an
object
#bits
an
object
Outputs
bits
an
object
#bits
an
object
Definition
USING:
combinators.short-circuit
kernel
math
;
IN:
bitstreams
:
check-widthed
( bits #bits -- bits #bits )
2dup
{
[
nip
0
<
]
[
{
[
nip
0
=
]
[
drop
0
=
not
]
}
2&&
]
[
swap
[
drop
f
]
[
dup
0
<
[
neg
]
when
log2
<=
]
if-zero
]
}
2||
[
invalid-widthed
]
when
;