1
0
mirror of https://github.com/nlohmann/json.git synced 2026-07-30 15:43:01 +04:00

🎨 use Clang-Format

This commit is contained in:
Niels Lohmann
2023-11-29 15:02:51 +01:00
parent d16f4496eb
commit 286f0c7647
102 changed files with 15937 additions and 11289 deletions
+4 -7
View File
@@ -15,7 +15,8 @@
#include <nlohmann/json.hpp>
using nlohmann::detail::dtoa_impl::reinterpret_bits;
namespace {
namespace
{
float make_float(uint32_t sign_bit, uint32_t biased_exponent, uint32_t significand)
{
assert(sign_bit == 0 || sign_bit == 1);
@@ -60,9 +61,7 @@ float make_float(uint64_t f, int e)
e--;
}
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
? 0
: static_cast<uint64_t>(e + kExponentBias);
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0) ? 0 : static_cast<uint64_t>(e + kExponentBias);
const uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
return reinterpret_bits<float>(static_cast<uint32_t>(bits));
@@ -112,9 +111,7 @@ double make_double(uint64_t f, int e)
e--;
}
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0)
? 0
: static_cast<uint64_t>(e + kExponentBias);
const uint64_t biased_exponent = (e == kDenormalExponent && (f & kHiddenBit) == 0) ? 0 : static_cast<uint64_t>(e + kExponentBias);
const uint64_t bits = (f & kSignificandMask) | (biased_exponent << kPhysicalSignificandSize);
return reinterpret_bits<double>(bits);