mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-26 18:51:04 +08:00
extract variable
This commit is contained in:
parent
7c7ccbf934
commit
c51d718ead
@ -852,9 +852,11 @@ bool Value::asBool() const {
|
||||
return value_.int_ ? true : false;
|
||||
case uintValue:
|
||||
return value_.uint_ ? true : false;
|
||||
case realValue:
|
||||
// According to JavaScript language zero or NaN is regarded as false
|
||||
return std::fpclassify(value_.real_) != FP_ZERO && std::fpclassify(value_.real_) != FP_NAN;
|
||||
case realValue: {
|
||||
// According to JavaScript language zero or NaN is regarded as false
|
||||
const auto value_classification = std::fpclassify(value_.real_);
|
||||
return value_classification != FP_ZERO && value_classification != FP_NAN;
|
||||
}
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user