about summary refs log tree commit diff stats
path: root/010vm.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-09-08 11:23:32 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-09-08 11:23:32 -0700
commit7426258146a0ddb624ab5def394ad38611c7caff (patch)
tree7cb8d440a5eeb9a9ce024fc3d597bb1f9f517d73 /010vm.cc
parent32d4af5458a97152f19b97af664cf22599e1b3fd (diff)
downloadmu-7426258146a0ddb624ab5def394ad38611c7caff.tar.gz
3305 - show all available precision in numbers
Thanks Ella Couch for pointing out that Mu was lying when debugging
small numbers.

  def main [
    local-scope
    x:number <- copy 1
    {
      x <- divide x, 2
      $print x, 10/newline
      loop  # until SIGFPE
    }
  ]
Diffstat (limited to '010vm.cc')
-rw-r--r--010vm.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/010vm.cc b/010vm.cc
index cce19e3d..23d4ef0b 100644
--- a/010vm.cc
+++ b/010vm.cc
@@ -662,6 +662,7 @@ ostream& operator<<(ostream& os, no_scientific x) {
     return os;
   }
   ostringstream tmp;
+  tmp.precision(308);  // for 64-bit numbers
   tmp << std::fixed << x.x;
   os << trim_floating_point(tmp.str());
   return os;