Print float with number of signif digits, double with 8.

This commit is contained in:
Axel Naumann 2017-12-04 22:53:15 -06:00 committed by sftnight
parent 1ac9f65512
commit 56b0e8e184

View File

@ -330,13 +330,13 @@ namespace cling {
// Reals
std::string printValue(const float *val) {
cling::smallstream strm;
strm << llvm::format("%#.5g", *val) << 'f';
strm << llvm::format("%#.6g", *val) << 'f';
return strm.str();
}
std::string printValue(const double *val) {
cling::smallstream strm;
strm << llvm::format("%#.6g", *val);
strm << llvm::format("%#.8g", *val);
return strm.str();
}