Store floating point numbers in double precision
Even on 32-bit systems, Value has enough space to hold a double.
This commit is contained in:
parent
91f49ca108
commit
a92ed973e5
2 changed files with 2 additions and 1 deletions
|
@ -44,7 +44,7 @@ class JSONPlaceholder;
|
||||||
|
|
||||||
|
|
||||||
typedef long NixInt;
|
typedef long NixInt;
|
||||||
typedef float NixFloat;
|
typedef double NixFloat;
|
||||||
|
|
||||||
/* External values must descend from ExternalValueBase, so that
|
/* External values must descend from ExternalValueBase, so that
|
||||||
* type-agnostic nix functions (e.g. showType) can be implemented
|
* type-agnostic nix functions (e.g. showType) can be implemented
|
||||||
|
|
|
@ -31,6 +31,7 @@ template<> void toJSON<unsigned long>(std::ostream & str, const unsigned long &
|
||||||
template<> void toJSON<long long>(std::ostream & str, const long long & n) { str << n; }
|
template<> void toJSON<long long>(std::ostream & str, const long long & n) { str << n; }
|
||||||
template<> void toJSON<unsigned long long>(std::ostream & str, const unsigned long long & n) { str << n; }
|
template<> void toJSON<unsigned long long>(std::ostream & str, const unsigned long long & n) { str << n; }
|
||||||
template<> void toJSON<float>(std::ostream & str, const float & n) { str << n; }
|
template<> void toJSON<float>(std::ostream & str, const float & n) { str << n; }
|
||||||
|
template<> void toJSON<double>(std::ostream & str, const double & n) { str << n; }
|
||||||
|
|
||||||
template<> void toJSON<std::string>(std::ostream & str, const std::string & s)
|
template<> void toJSON<std::string>(std::ostream & str, const std::string & s)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue