Legend:
Library
Module
Module type
Parameter
Class
Class type
Typed Values Representation. This module defines types and utilities for representing values with different numeric types, including integers and floating-point numbers. It also provides functions for type checking, comparison, formatting, and conversion.
Value Types
type t =
| I8of int
(*
8-bit integer.
*)
| I32of int32
(*
32-bit integer.
*)
| I64of int64
(*
64-bit integer.
*)
| F32of int32
(*
32-bit floating-point value, stored as an int32.
*)
| F64of int64
(*
64-bit floating-point value, stored as an int64.
*)
The type t represents values with different numeric types.
compare v1 v2 provides a total ordering over values of type t. It returns a negative integer if v1 is less than v2, zero if they are equal, and a positive integer if v1 is greater than v2.
num_of_bool b converts a boolean b into an integer value of type t. The exact representation depends on the system's convention, typically 1 for true and 0 for false.