Handbook
Glossary
>be ( x n -- byte-array )
Working with binary data
Prev:
le> ( seq -- x )
Next:
>le ( x n -- byte-array )
Vocabulary
endian
Inputs
x
an
integer
n
a non-negative integer
Outputs
byte-array
a
byte-array
Word description
Converts an integer
x
into a string of
n
bytes in big endian order. Truncation will occur if the integer is not in the range
[-2^(8n),2^(8n))
.
Definition
USING:
alien.c-types
alien.data
combinators
endian.private
kernel
;
IN:
endian
:
>be
( x n -- byte-array )
compute-native-endianness
big-endian
=
[
{
{
2
[
int16_t
<ref>
]
}
{
4
[
int32_t
<ref>
]
}
{
8
[
int64_t
<ref>
]
}
[
>slow-be
]
}
case
]
[
>slow-be
]
if
;