Skip to content

Commit

Permalink
Fixes to tool/aube
Browse files Browse the repository at this point in the history
At very long times aube was dropping decimal places in the output
precision. This is fixed now to one more digit than needed from the dt
point of view.
  • Loading branch information
Friedemann Zenke committed Dec 3, 2015
1 parent b2b18fb commit 34b5112
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/aube.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ int main(int ac, char* av[])
double to_time = -1.0;
double seconds_to_extract_from_end = -1.0; // negative means disabled
NeuronID maxid = std::numeric_limits<NeuronID>::max();
// one more decimal than neede to show values are not rounded
int decimal_places = -std::log(dt)/std::log(10)+2;

try {
po::options_description desc("Allowed options");
Expand Down Expand Up @@ -267,7 +269,10 @@ int main(int ac, char* av[])
if( !output_file_name.empty() ) {
write_to_stdout = false;
of.open( output_file_name.c_str(), std::ofstream::out );
of << std::fixed << std::setprecision(decimal_places);
}
// sets output format to right number of decimal places
std::cout << std::fixed << std::setprecision(decimal_places);

while ( true ) {
// find smallest time reference
Expand Down

0 comments on commit 34b5112

Please sign in to comment.