MCPcopy Create free account
hub / github.com/0xShug0/audio.cpp / json_optional_float

Function json_optional_float

app/cli/request.cpp:81–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79 if (value.is_number()) {
80 const double number = value.as_number();
81 constexpr double kMaxExactJsonInteger = 9007199254740992.0; // 2^53
82 if (std::isfinite(number) && std::trunc(number) == number && std::fabs(number) < kMaxExactJsonInteger) {
83 std::ostringstream out;
84 out << std::fixed << std::setprecision(0) << number;
85 return out.str();
86 }
87 return engine::io::json::stringify_number(number);
88 }
89 return engine::io::json::stringify(value);
90}
91
92std::unordered_map<std::string, std::string> json_options_map(const engine::io::json::Value * value) {

Callers 1

build_request_from_jsonFunction · 0.85

Calls 3

is_nullMethod · 0.80
as_f32Method · 0.80
findMethod · 0.45

Tested by

no test coverage detected