chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7fd3619
)
wip notes about repr
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 4 Oct 2020 10:43:09 +0000
(11:43 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sun, 4 Oct 2020 10:43:09 +0000
(11:43 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
templates/bigfloat.ts
patch
|
blob
|
history
diff --git
a/templates/bigfloat.ts
b/templates/bigfloat.ts
index ed3495661e64b04a75b89e4210bbd8bfa3046f98..89ba8b9e158f4daed5639b3c5d5fa1fc7360570e 100644
(file)
--- 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]