MCPcopy Create free account
hub / github.com/Vector35/binaryninja-api / asDouble

Method asDouble

json/jsoncpp.cpp:3263–3283  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3261}
3262
3263double Value::asDouble() const {
3264 switch (type_) {
3265 case intValue:
3266 return static_cast<double>(value_.int_);
3267 case uintValue:
3268#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3269 return static_cast<double>(value_.uint_);
3270#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3271 return integerToDouble(value_.uint_);
3272#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3273 case realValue:
3274 return value_.real_;
3275 case nullValue:
3276 return 0.0;
3277 case booleanValue:
3278 return value_.bool_ ? 1.0 : 0.0;
3279 default:
3280 break;
3281 }
3282 JSON_FAIL_MESSAGE("Value is not convertible to double.");
3283}
3284
3285float Value::asFloat() const {
3286 switch (type_) {

Callers 1

writeValueMethod · 0.80

Calls 1

integerToDoubleFunction · 0.85

Tested by

no test coverage detected