mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2025-10-17 19:25:52 +02:00
For gcc>=6 JSON_USE_INT64_DOUBLE_CONVERSION
This commit is contained in:
@@ -784,7 +784,8 @@ float Value::asFloat() const {
|
||||
#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
|
||||
return static_cast<float>(value_.uint_);
|
||||
#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
|
||||
return integerToDouble(value_.uint_);
|
||||
// This can fail (silently?) if the value is bigger than MAX_FLOAT.
|
||||
return static_cast<float>(integerToDouble(value_.uint_));
|
||||
#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
|
||||
case realValue:
|
||||
return static_cast<float>(value_.real_);
|
||||
|
Reference in New Issue
Block a user