MCPcopy Create free account
hub / github.com/Illumina/paragraph / asDouble

Method asDouble

external/jsoncpp/jsoncpp.cpp:3306–3326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3304}
3305
3306double Value::asDouble() const {
3307 switch (type_) {
3308 case intValue:
3309 return static_cast<double>(value_.int_);
3310 case uintValue:
3311#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3312 return static_cast<double>(value_.uint_);
3313#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3314 return integerToDouble(value_.uint_);
3315#endif // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
3316 case realValue:
3317 return value_.real_;
3318 case nullValue:
3319 return 0.0;
3320 case booleanValue:
3321 return value_.bool_ ? 1.0 : 0.0;
3322 default:
3323 break;
3324 }
3325 JSON_FAIL_MESSAGE("Value is not convertible to double.");
3326}
3327
3328float Value::asFloat() const {
3329 switch (type_) {

Callers 7

estimateDepthsFunction · 0.80
loadManifestFunction · 0.80
setFromJsonMethod · 0.80
setAlleleErrorRateMethod · 0.80
setGenotypeFractionsMethod · 0.80
writeValueMethod · 0.80

Calls 1

integerToDoubleFunction · 0.85

Tested by

no test coverage detected