package orsetto
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=9b654edb663ae697563f150824047052f3b1bf760398f24bce6350553f031f73c46b6337239a1acd871e61238597ea92046809e3358290ff14d6ba671b449085
doc/orsetto.cf/Cf_endian_core/index.html
Module Cf_endian_core
Utility functions for safe operations with byte-order sensitive data.
Overview
Ancillary internal functions used to check the validity of numeric quantity and octet sequence subrange parameters in the Cf_endian
interface.
Signatures
module type Unsafe = sig ... end
The 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 can converted between representations without error.
module type Safe = sig ... end
This module type defines octet encoding and decoding schemes for the various integer and floating point types.
Modules
module Unsafe_octet : sig ... end
Include this module to include operations single-octet types.
Exception raised when conversion to binary16 or binary32 truncates the fractional part or overflows the exponent.
Use of_fp16_bits n
to convert a binary16 format integer representation of IEEE-754 "half-precision" floating point number.
Use to_fp16_bits n
to convert a floating point number into its binary16 format integer representation of IEEE-754 "half-precision" floating point. Raises Imprecise
if conversion truncates the fractional part or overflows the exponent.
Use to_fp32_bits n
to convert a floating point number into its binary32 format integer representation of IEEE-754 "single-precision" floating point. Raises Imprecise
if conversion truncates the fractional part or overflows the exponent.
Use to_fp16_bits n
to convert a floating point number into its binary16 format integer representation of IEEE-754 "half-precision" floating point. Fractional bits beyond the first ten are truncated. If the exponent is out of range, then infinity is returned. If n = nan
then result is the distinguished binary16 form of a signaling NaN.
Use to_fp32_bits n
to convert a floating point number into its binary32 format integer representation of IEEE-754 "single-precision" floating point. Fractional bits beyond the first ten are truncated. If the exponent is out of range, then infinity is returned. If n = nan
then result is the distinguished binary32 form of a signaling NaN.