Handbook
Glossary
>le ( x n -- byte-array )
Working with binary data
Prev:
>be ( 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 little 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
:
>le
( x n -- byte-array )
compute-native-endianness
little-endian
=
[
{
{
2
[
int16_t
<ref>
]
}
{
4
[
int32_t
<ref>
]
}
{
8
[
int64_t
<ref>
]
}
[
>slow-le
]
}
case
]
[
>slow-le
]
if
;