Handbook
Glossary
bits>half ( bits -- float )
Vocabulary
math
.
floats
.
half
Inputs
bits
an
object
Outputs
float
an
object
Definition
USING:
kernel
math
;
IN:
math.floats.half
:
bits>half
( bits -- float )
[
-15
shift
31
shift
]
[
32767
bitand
dup
zero?
[
dup
31744
>=
[
13
shift
2139095040
bitor
]
[
dup
1024
<
[
dup
log2
[
nip
103
+
23
shift
]
[
23
swap
-
shift
8388607
bitand
]
2bi
bitor
]
[
13
shift
112 23
shift
+
]
if
]
if
]
unless
]
bi
bitor
bits>float
;