From 4082acd24f0049604f840fb5e60977e247aafbdf Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 14 Sep 2015 23:30:03 -0700 Subject: 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. --- 044space.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '044space.cc') 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(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; } -- cgit 1.4.1-2-gfad0