From 8ed7664fd31309b1aeb4ccfb795721204121136a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 4 Oct 2020 11:43:09 +0100 Subject: [PATCH] wip notes about repr Signed-off-by: Ian Jackson --- templates/bigfloat.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/templates/bigfloat.ts b/templates/bigfloat.ts index ed349566..89ba8b9e 100644 --- a/templates/bigfloat.ts +++ b/templates/bigfloat.ts @@ -7,9 +7,21 @@ // This is a really really shonky BigFloat with only a handful of // operations available! + +// Representation requirements: +// CBOR is binary and compact +// JSON is not lossy +// Nice-to-haves: +// JSON + + type Bigfloat_Json = number[]; class Bigfloat { + // syntqax: + // [!] EEEE ! VVVVVVVV + + exponent: number; limbs: number[]; // BE, limbs are each in [ 0, 2^48 ) // binary point is just before limbs[0] -- 2.30.2