MCPcopy Create free account
hub / github.com/bytedance/sonic-cpp / GetDouble

Function GetDouble

include/sonic/dom/genericnode.h:374–382  ·  view source on GitHub ↗

* @brief Get double data. * @return double */

Source from the content-addressed store, hash-verified

372 * @return double
373 */
374 sonic_force_inline double GetDouble() const noexcept {
375 sonic_assert(IsNumber());
376 if (IsDouble()) return n.f64;
377 if (IsUint64())
378 return static_cast<double>(
379 n.u64); // uint64_t -> double (may lose precision))
380 return static_cast<double>(
381 n.i64); // int64_t -> double (may lose precision))
382 }
383
384 // Set APIs
385 /**

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected