diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-09-14 23:30:03 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-09-14 23:37:12 -0700 |
commit | 4082acd24f0049604f840fb5e60977e247aafbdf (patch) | |
tree | ee0e15149954af80c20f010c47b2f412961ee199 /044space.cc | |
parent | e28fa5f1508ef7ffeb0b72406558534928c28f9e (diff) | |
download | mu-4082acd24f0049604f840fb5e60977e247aafbdf.tar.gz |
2199 - stop printing numbers in scientific notation
Turns out the default format for printing floating point numbers is neither 'scientific' nor 'fixed' even though those are the only two options offered. Reading the C++ standard I found out that the default (modulo locale changes) is basically the same as the printf "%g" format. And "%g" is basically the shorter of: a) %f with trailing zeros trimmed b) %e So we'll just do %f and trim trailing zeros.
Diffstat (limited to '044space.cc')
-rw-r--r-- | 044space.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/044space.cc b/044space.cc index 737e80b9..eddf457e 100644 --- a/044space.cc +++ b/044space.cc @@ -204,7 +204,7 @@ long long int address(long long int offset, long long int base) { if (base == 0) return offset; // raw if (offset >= static_cast<long long int>(Memory[base])) { // todo: test - raise << "location " << offset << " is out of bounds " << Memory[base] << " at " << base << '\n' << end(); + raise << "location " << offset << " is out of bounds " << no_scientific(Memory[base]) << " at " << base << '\n' << end(); } return base+1 + offset; } |