about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <github@akkartik.com>2021-06-17 21:27:05 -0700
committerGitHub <noreply@github.com>2021-06-17 21:27:05 -0700
commitee429152820724f3bf33de94ae14c02f71152a09 (patch)
tree43f218542791a44192433b58b46cacebf67ea4af
parentdd60caa3f51c5117c0193f8f3272e1c7f5230eb7 (diff)
parentbad113ebc093769c85452f5566935b906210e74c (diff)
downloadmu-ee429152820724f3bf33de94ae14c02f71152a09.tar.gz
Merge pull request #47 from akkartik/fix-precision
Fix precision
-rw-r--r--.gitignore3
-rw-r--r--shell/print.mu4
2 files changed, 5 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 00000000..4581dc45
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,3 @@
+a.*
+*.img
+labels
diff --git a/shell/print.mu b/shell/print.mu
index ef599dc7..ea5db3cf 100644
--- a/shell/print.mu
+++ b/shell/print.mu
@@ -217,7 +217,7 @@ fn print-number _in: (addr cell), out: (addr stream byte), trace: (addr trace) {
   }
   var in/esi: (addr cell) <- copy _in
   var val/eax: (addr float) <- get in, number-data
-  write-float-decimal-approximate out, *val, 3/precision
+  write-float-decimal-approximate out, *val, 0x10/precision
   # trace
   {
     var should-trace?/eax: boolean <- should-trace? trace
@@ -228,7 +228,7 @@ fn print-number _in: (addr cell), out: (addr stream byte), trace: (addr trace) {
   var stream-storage: (stream byte 0x40)
   var stream/ecx: (addr stream byte) <- address stream-storage
   write stream, "=> number "
-  write-float-decimal-approximate stream, *val, 3/precision
+  write-float-decimal-approximate stream, *val, 0x10/precision
   trace trace, "print", stream
 }