我要评分
获取效率
正确性
完整性
易理解

JsonElement::getAsDouble() const

Function Usage

Uses errno to indicate an invalid call if the JsonElement node is not of a numeric type, or otherwise, returns the double value of the node.

Function Syntax

double JsonElement::getAsDouble() const;

Return Value

  • Success: the double value of the node.
  • Failure: an uninitialized double value.

If the data type of the node is not double, data type conversion occurs, which may cause precision loss.