package smtml
Install
dune-project
Dependency
Authors
-
JJoão Pereira <joaomhmpereira@tecnico.ulisboa.pt>
-
FFilipe Marques <filipe.s.marques@tecnico.ulisboa.pt>
-
HHichem Rami Ait El Hara <hra@ocamlpro.com>
-
Rredianthus <redopam@pm.me>
-
AArthur Carcano <arthur.carcano@ocamlpro.com>
-
PPierre Chambart <pierre.chambart@ocamlpro.com>
-
JJosé Fragoso Santos <jose.fragoso@tecnico.ulisboa.pt>
Maintainers
Sources
md5=dccec4e664735d96f7d5e867f8c0841f
sha512=4e1586451c0e61dcae6bd46bb8fe899430b383c776dbf214cffcd6802449ee522f4658e2990ac1a1ad6f8e89f72a8d83ba0a40a7d33b2faaa9f8ae0c7a1d0c67
doc/smtml/Smtml/Num/index.html
Module Smtml.NumSource
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
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.
Pretty Printing
pp_with ~printer allows explicit selection of the printing format.
pp_no_type is a formatter that prints a value of type t without displaying its type.
Serialization
of_string ty s attempts to parse the string s as a value of type ty. Returns Ok v on success, or an error message if parsing fails.
to_json v converts the value v into a JSON representation.