Commit 3116cb54 authored by Nabil Chouika's avatar Nabil Chouika
Browse files

refs#16

In ElementaryUtils (trunk):
- Better implementation of the precision in Formatter and GenericType.
parent 5a40dc3b
......@@ -8,10 +8,11 @@
* @version 1.0
*/
#include <stddef.h>
#include <iomanip>
#include <limits>
#include <sstream>
#include <string>
#include <cstddef>
namespace ElemUtils {
......@@ -30,7 +31,7 @@ public:
*/
template<class T>
GenericType(const T &value) {
m_stream << std::setprecision(16) << value;
m_stream << std::setprecision(std::numeric_limits<double>::digits10) << value;
}
/**
......
......@@ -12,6 +12,7 @@
#include <iomanip>
#include <sstream>
#include <string>
#include <limits>
namespace ElemUtils {
......@@ -23,7 +24,7 @@ class Formatter {
public:
Formatter() {
// use to print full precision double
m_stream << std::setprecision(16);
m_stream << std::setprecision(std::numeric_limits<double>::digits10);
}
~Formatter() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment