00001 #include <json.hpp> 00002 00003 using json = nlohmann::json; 00004 00005 int main() 00006 { 00007 // create values of different floating-point types 00008 float f42 = 42.23; 00009 float f_nan = 1.0f / 0.0f; 00010 double f23 = 23.42; 00011 00012 // create JSON numbers 00013 json j42(f42); 00014 json j_nan(f_nan); 00015 json j23(f23); 00016 00017 // serialize the JSON numbers 00018 std::cout << j42 << '\n'; 00019 std::cout << j_nan << '\n'; 00020 std::cout << j23 << '\n'; 00021 }