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

Function GetDouble

rapidjson/document.h:1695–1702  ·  view source on GitHub ↗

Get the value as double type. ! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless. */

Source from the content-addressed store, hash-verified

1693 /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessDouble() to check whether the converison is lossless.
1694 */
1695 double GetDouble() const {
1696 RAPIDJSON_ASSERT(IsNumber());
1697 if ((data_.f.flags & kDoubleFlag) != 0) return data_.n.d; // exact type, no conversion.
1698 if ((data_.f.flags & kIntFlag) != 0) return data_.n.i.i; // int -> double
1699 if ((data_.f.flags & kUintFlag) != 0) return data_.n.u.u; // unsigned -> double
1700 if ((data_.f.flags & kInt64Flag) != 0) return static_cast<double>(data_.n.i64); // int64_t -> double (may lose precision)
1701 RAPIDJSON_ASSERT((data_.f.flags & kUint64Flag) != 0); return static_cast<double>(data_.n.u64); // uint64_t -> double (may lose precision)
1702 }
1703
1704 //! Get the value as float type.
1705 /*! \note If the value is 64-bit integer type, it may lose precision. Use \c IsLosslessFloat() to check whether the converison is lossless.

Callers 4

operator==Function · 0.85
IsFloatFunction · 0.85
IsLosslessFloatFunction · 0.85
GetFloatFunction · 0.85

Calls 1

IsNumberFunction · 0.85

Tested by

no test coverage detected