From: Ian Jackson Date: Sun, 4 Oct 2020 10:43:09 +0000 (+0100) Subject: wip notes about repr X-Git-Tag: otter-0.2.0~771 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=8ed7664fd31309b1aeb4ccfb795721204121136a;p=otter.git wip notes about repr Signed-off-by: Ian Jackson --- 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]