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:
Eelco Dolstra 2018-07-03 18:04:51 +02:00
parent 91f49ca108
commit a92ed973e5
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
2 changed files with 2 additions and 1 deletions

View file

@ -44,7 +44,7 @@ class JSONPlaceholder;
typedef long NixInt;
typedef float NixFloat;
typedef double NixFloat;
/* External values must descend from ExternalValueBase, so that
* type-agnostic nix functions (e.g. showType) can be implemented

View file

@ -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<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<double>(std::ostream & str, const double & n) { str << n; }
template<> void toJSON<std::string>(std::ostream & str, const std::string & s)
{