package orsetto
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=f64814687276bad56483b2b8dfaaf70d0d6485f67fe5d44bff34bfa47af1896e
md5=3a15a377800cf988a310b4082406c685
doc/orsetto.cf/Cf_endian_little/index.html
Module Cf_endian_little
Utility functions for little-endian byte order.
Overview
Primitive functions for ingesting and rendering integers and floating point numbers to and from subranges of strings and byte sequences using the "little-endian" explicit octet ordering discipline.
Module inclusion
include Cf_endian_core.Safe
A Latin-1 string describing the endian mode, e.g. "LE" for little-endian or "BE" for big-endian.
val lds8 : int Cf_decode.schemeUse r#scan lds8 to read one octet with r as a signed 8-bit integer in the range -128 to 127.
val ldu8 : int Cf_decode.schemeUse r#scan ldu8 to read one octet with r as an unsigned 8-bit integer in the range 0 to 255.
val lds16 : int Cf_decode.schemeUse r#scan lds16 to read two octets with r as a signed 16-bit integer in the range -32768 to 32767.
val ldu16 : int Cf_decode.schemeUse r#scan ldu16 to read two octets with r as an unsigned 16-bit integer in the range 0 to 65535.
val lds32 : int Cf_decode.schemeUse r#scan lds32 to read four octets with r as a signed 32-bit integer in the range -2147483648 to 2147483647. Raises Cf_decode.Invalid where Sys.int_length < 32 and the value cannot be represented by the OCaml int type.
val ldu32 : int Cf_decode.schemeUse r#scan ldu32 to read four octets with r as an unsigned 32-bit integer in the range 0 to 4294967295. Raises Cf_decode.Invalid if the value cannot be represented by the OCaml int type.
val lds64 : int Cf_decode.schemeUse r#scan lds64 to read eight octets with r as a signed 64-bit integer in the range -9223372036854775808 to 9223372036854775807. Raises Cf_decode.Invalid if the value cannot be represented by the OCaml int type.
val ldu64 : int Cf_decode.schemeUse r#scan ldu64 to read eight octets with r as an unsigned 64-bit integer in the range 0 to 18446744073709551615. Raises Cf_decode.Invalid if the value cannot be represented by the OCaml int type.
val ldi32 : int32 Cf_decode.schemeUse r#scan ldi32 to read four octets with r as a signed 32-bit integer in the range -2147483648 to 2147483647.
val ldi64 : int64 Cf_decode.schemeUse r#scan ldi32 to read eight octets with r as a signed 64-bit integer in the range -9223372036854775808 to 9223372036854775807.
val ldf16 : float Cf_decode.schemeUse r#scan ldf16 to read two octets with r as a binary16 format IEEE 754 floating point number.
val ldf32 : float Cf_decode.schemeUse r#scan ldf32 to read four octets with r as a binary32 format IEEE 754 floating point number.
val ldf64 : float Cf_decode.schemeUse r#scan ldf64 to read eight octets with r as a binary64 format IEEE 754 floating point number.
val sts8 : int Cf_encode.schemeUse w#emit sts8 to write with w a signed 8-bit integer as one octet. Raises Invalid_argument if the value to emit is not in the range -128 to 127.
val stu8 : int Cf_encode.schemeUse w#emit stu8 to write with w an unsigned 8-bit integer as one octet. Raises Invalid_argument if the value to emit is not in the range 0 to 255.
val sts16 : int Cf_encode.schemeUse w#emit sts16 to write with w a signed 16-bit integer as two octets. Raises Invalid_argument if the value to emit is not in the range -32768 to 32767.
val stu16 : int Cf_encode.schemeUse w#emit stu16 to write with w an unsigned 16-bit integer as two octets. Raises Invalid_argument if the value to emit is not in the range 0 to 65535.
val sts32 : int Cf_encode.schemeUse w#emit sts32 to write with w a signed 32-bit integer as four octets. Raises Invalid_argument if the value to emit is not in the range -32768 to 32767.
val stu32 : int Cf_encode.schemeUse w#emit stu32 to write with w an unsigned 32-bit integer as four octets. Raises Invalid_argument if the value to emit is not in the range 0 to 65535.
val sts64 : int Cf_encode.schemeUse w#emit sts64 to write with w a signed 64-bit integer as eight octets. Raises Invalid_argument if the value to emit is not in the range -9223372036854775808 to 9223372036854775807.
val stu64 : int Cf_encode.schemeUse w#emit stu64 to write with w an unsigned 64-bit integer as eight octets. Raises Invalid_argument if the value to emit is not in the range 0 to 18446744073709551615.
val sti32 : int32 Cf_encode.schemeUse w#emit sti32 to write with w a signed 32-bit integer as four octets.
val sti64 : int64 Cf_encode.schemeUse w#emit sti64 to write with w a signed 64-bit integer as eight octets.
val stf16 : float Cf_encode.schemeUse w#emit stf16 to write with w a floating point number as the four octets comprising a binary16 format IEEE 754 number. Raises Imprecise if the conversion truncates the fractional part or overflows the exponent part. Conversion of NaN always results in a signaling NaN.
val stf32 : float Cf_encode.schemeUse w#emit stf32 to write with w a floating point number as the four octets comprising a binary32 format IEEE 754 number. Raises Imprecise if the conversion truncates the fractional part or overflows the exponent part. Conversion of NaN always results in a signaling NaN.
val stf64 : float Cf_encode.schemeUse w#emit stf64 to write with w a floating point number as the eight octets comprising a binary64 format IEEE 754 number.
module Unsafe : sig ... endThe functions in this module offer fast unsafe operations that provide correct behavior only when the parameters are valid, i.e. when the position and length are valid for the string or byte sequence, and when integer and float quantities are valid for the specific external representation.