abla/float/text

Generated from source.

Import with import "abla/float/text".

Source: abla/float/text/entry.ab

f64Text (fun)

fun f64Text(value: f64): string

value as the shortest decimal that reads back as exactly it, written the way JavaScript's Number#toString writes it: "0.1", "100", "1.5e-7", "1e+21", "-0.25"; NaN, "Infinity", "-Infinity", and "0" for both zeros.

ByteBuffer.appendF64 (extension fun)

fun ByteBuffer.appendF64(value: f64): void

Appends f64Text(value) to the buffer; integers and the short decimals (all but the very large, very small and 17-digit values) without making a string.

f64TextDigits (fun)

fun f64TextDigits(exponentBits: int, fractionBits: int): array<int>

The shortest digits (Steele & White / Burger & Dybvig's free-format algorithm on exact big integers): [the point's position, digit, digit, …].

f64BigOf (fun)

fun f64BigOf(value: int): array<int>

Returns the little-endian base-2^32 limbs of value or an empty array for zero or a negative input.

f64BigShift (fun)

fun f64BigShift(value: array<int>, bits: int): array<int>

Returns new little-endian base-2^32 limbs shifted left by bits, which must be nonnegative.

f64Parse (fun)

fun f64Parse(text: string): f64

The decimal number in text as the nearest f64 (round half to even), the way JavaScript's Number() and JSON.parse read it: "0.1", "-12", "1.5e-7", "1E+21", ".5", "5."; "Infinity" and "-Infinity"; NaN for anything else (and for "NaN").

f64ParseRange (fun)

fun f64ParseRange(text: string, begin: int, end: int): f64

f64Parse of text[begin, end), without copying it. Up to 18 significant digits scaled by 10^±22 (any JSON a program writes: coordinates, angles, money) read without allocating; anything longer or farther out is read exactly on big integers.

F64_PARSE_FIVES (val)

@threadShared
val F64_PARSE_FIVES: array<int>

Read-only tables (threads share them).

F64_PARSE_TENS (val)

@threadShared
val F64_PARSE_TENS: array<f64>

Powers of ten from 10^0 through 10^22 for the decimal parser.

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.