MCPcopy Create free account
hub / github.com/arun11299/cpp-jwt / write_compact_float

Method write_compact_float

include/jwt/json/json.hpp:14251–14269  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14249 }
14250
14251 void write_compact_float(const number_float_t n, detail::input_format_t format)
14252 {
14253 if (static_cast<double>(n) >= static_cast<double>(std::numeric_limits<float>::lowest()) &&
14254 static_cast<double>(n) <= static_cast<double>((std::numeric_limits<float>::max)()) &&
14255 static_cast<double>(static_cast<float>(n)) == static_cast<double>(n))
14256 {
14257 oa->write_character(format == detail::input_format_t::cbor
14258 ? get_cbor_float_prefix(static_cast<float>(n))
14259 : get_msgpack_float_prefix(static_cast<float>(n)));
14260 write_number(static_cast<float>(n));
14261 }
14262 else
14263 {
14264 oa->write_character(format == detail::input_format_t::cbor
14265 ? get_cbor_float_prefix(n)
14266 : get_msgpack_float_prefix(n));
14267 write_number(n);
14268 }
14269 }
14270
14271 public:
14272 // 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