/** * @copyright Sister Software * @license AGPL-3.0 * @author Teffen Ellis, et al. * * Python-parity numeric helpers — the third member of the `python-*` family in this directory, * beside `python-json.ts` (CPython `json.dumps` spacing) and `python-random.ts` (`random.Random`). * * These exist because the gazetteer pipeline was ported from Python and its outputs have to match * the originals bit for bit: a postcode centroid that rounds differently is a different centroid, * and the shard it lands in is a different shard. Divergence here never throws — it surfaces as a * shard that quietly disagrees with the reference. */ /** * Increment a non-negative decimal-digit string, propagating the carry (e.g. "999" → "1000"). */ export declare function incDecimalString(s: string): string; /** * Python `round()` — correctly-rounded, round-half-to-EVEN. Works off the double's EXACT (terminating) decimal * expansion via `toFixed(80)`, so it matches Python both on ordinary values (where a naïve `x * 10**nd` would diverge * by a ULP) and on exact half-way ties like `40.890625` → `40.89062` (where `toFixed(nd)` rounds half-UP and would * diverge). `nd === 0` keeps a fast half-even path on the double. */ export declare function pyRound(x: number, nd?: number): number; /** * Python `float()`: trimmed-empty / non-numeric → null (the build's try/except skip). */ export declare function pyFloat(s: string | undefined): number | null; /** * Python `format(x, ".{d}f")` — round-half-to-even (banker's), unlike JS `toFixed` (half-away). */ export declare function pyFixed(x: number, d: number): string; //# sourceMappingURL=python-numeric.d.ts.map