Exact finite IEEE-754 binary64 codecs for persistent MiniSQL values.
Package: minisql.common.float_codec
Reachable from entry: yes
minisql/common/endian.mlasendian→ src/minisql/common/endian.mlstd/math.mlasmath→../MiniLangCompilerML/std/math.ml— external dependency
function componentName()Returns this module's stable registry name.
const CORRUPT_DATA = 9004function decodeFloat64LE(source, offset)Decodes finite binary64, preserving negative zero and the full 53-bit significand.
| Parameter | Type | Default | Description |
|---|---|---|---|
source |
dynamic |
— | Input byte buffer. |
offset |
dynamic |
— | Start of the eight-byte value. |
function encodeFloat64LE(value)Encodes a finite number without changing zero's sign or losing subnormal bits.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
dynamic |
— | MiniLang numeric value; integers convert to binary64 by normal numeric semantics. |
const FRACTION_UNIT = 4503599627370496const INVALID_ARGUMENT = 9001function isFiniteEncoded(source, offset)Reports whether an encoded binary64 has a finite exponent, after bounds checks.
| Parameter | Type | Default | Description |
|---|---|---|---|
source |
dynamic |
— | Input byte buffer. |
offset |
dynamic |
— | Start of the eight-byte value. |
function isImplemented()Reports that the binary64 codec is available.
extern function nativeCopySign(value as double, signValue as double) from "msvcrt.dll" symbol "_copysign" returns doubleCopies the sign bit, including the sign of zero.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
— | |
signValue |
double |
— |
extern function nativeFinite(value as double) from "msvcrt.dll" symbol "_finite" returns i32Reports whether the native value is finite without unordered comparisons.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
— |
extern function nativeFrexp(value as double, exponent as bytes) from "msvcrt.dll" symbol "frexp" returns doubleSplits a native double into its exact binary significand and exponent.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
— | |
exponent |
bytes |
— |
extern function nativeLdexp(value as double, exponent as i32) from "msvcrt.dll" symbol "ldexp" returns doubleScales a native double by an integral power of two.
| Parameter | Type | Default | Description |
|---|---|---|---|
value |
double |
— | |
exponent |
i32 |
— |
function targetMilestone()Returns the storage generation that introduced this module.
const TYPE_MISMATCH = 9017const WIDTH = 8function writeFloat64LE(destination, offset, value)Writes a complete finite binary64 only after value and destination validation.
| Parameter | Type | Default | Description |
|---|---|---|---|
destination |
dynamic |
— | Output byte buffer. |
offset |
dynamic |
— | Start of the eight-byte destination. |
value |
dynamic |
— | Numeric value to encode. |