basic_json__number_float_t.cpp
Go to the documentation of this file.
00001 #include <json.hpp>
00002 
00003 using json = nlohmann::json;
00004 
00005 int main()
00006 {
00007     // create values of different floating-point types
00008     json::number_float_t v_ok = 3.141592653589793;
00009     json::number_float_t v_nan = NAN;
00010     json::number_float_t v_infinity = INFINITY;
00011 
00012     // create JSON numbers
00013     json j_ok(v_ok);
00014     json j_nan(v_nan);
00015     json j_infinity(v_infinity);
00016 
00017     // serialize the JSON numbers
00018     std::cout << j_ok << '\n';
00019     std::cout << j_nan << '\n';
00020     std::cout << j_infinity << '\n';
00021 }


rc_visard_driver
Author(s): Heiko Hirschmueller , Christian Emmerich , Felix Ruess
autogenerated on Thu Jun 6 2019 20:43:01