diff options
| author | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
|---|---|---|
| committer | Jacob McDonnell <jacob@jacobmcdonnell.com> | 2026-04-26 16:38:00 -0400 |
| commit | 97d5c458cfa039d857301e1ca7d5af3beb37131d (patch) | |
| tree | b460cd850d0537eb71806ba30358840377b27688 /static/inferno/man2/math-export.2 | |
| parent | b89dc2331a50c63f8b33272a5c4c61ab98abdaa3 (diff) | |
build: Better Build System
Diffstat (limited to 'static/inferno/man2/math-export.2')
| -rw-r--r-- | static/inferno/man2/math-export.2 | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/static/inferno/man2/math-export.2 b/static/inferno/man2/math-export.2 new file mode 100644 index 00000000..9c6c7b63 --- /dev/null +++ b/static/inferno/man2/math-export.2 @@ -0,0 +1,52 @@ +.TH MATH-EXPORT 2 +.SH NAME +Math: export_int, export_real, export_real32, import_int, import_real, import_real32 \- conversion to and from external representation +.SH SYNOPSIS +.EX +include "math.m"; +math := load Math Math->PATH; + +export_int: fn(b: array of byte, x: array of int); +export_real32: fn(b: array of byte, x: array of real); +export_real: fn(b: array of byte, x: array of real); + +import_int: fn(b: array of byte, x: array of int); +import_real32: fn(b: array of byte, x: array of real); +import_real: fn(b: array of byte, x: array of real); +.EE +.SH DESCRIPTION +These routines convert between Limbo's internal representation of +integer and floating-point values, and equivalent external representations as +arrays of bytes, allowing efficient input/output of binary representations. +.PP +.BI Export_int( b , \ x ) +converts each integer element of array +.I x +into a sequence of 4 bytes in array +.IR b . +.PP +.BI Export_real( b , \ x ) +converts each double-precision floating-point element of array +.I x +into a sequence of 8 bytes in array +.IR b . +.PP +.BI Export_real32( b , \ x ) +converts each double-precision floating-point element of array +.I x +to a single-precision value, then encodes it as a sequence of 4 bytes in array +.IR b . +.PP +Each +.BI import_ T +operation reverses the transformation of the corresponding +.BI export_ T +operation, converting an array of bytes containing a sequence of external representations +into an array of values of the appropriate internal form. +.PP +Values are encoded in big-endian order (most significant byte first), with floating-point +values represented in IEEE 32-bit or 64-bit form (again, most significant byte first). +.SH SOURCE +.B /libinterp/math.c +.SH SEE ALSO +.IR math-intro (2) |
