MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / write_compact_float

Method write_compact_float

dependencies/json/json.hpp:14325–14343  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14323 }
14324
14325 void write_compact_float(const number_float_t n, detail::input_format_t format)
14326 {
14327 if (static_cast<double>(n) >= static_cast<double>(std::numeric_limits<float>::lowest()) &&
14328 static_cast<double>(n) <= static_cast<double>((std::numeric_limits<float>::max)()) &&
14329 static_cast<double>(static_cast<float>(n)) == static_cast<double>(n))
14330 {
14331 oa->write_character(format == detail::input_format_t::cbor
14332 ? get_cbor_float_prefix(static_cast<float>(n))
14333 : get_msgpack_float_prefix(static_cast<float>(n)));
14334 write_number(static_cast<float>(n));
14335 }
14336 else
14337 {
14338 oa->write_character(format == detail::input_format_t::cbor
14339 ? get_cbor_float_prefix(n)
14340 : get_msgpack_float_prefix(n));
14341 write_number(n);
14342 }
14343 }
14344
14345 public:
14346 // The following to_char_type functions are implement the conversion

Callers

nothing calls this directly

Calls 1

write_characterMethod · 0.45

Tested by

no test coverage detected