mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2026-07-04 23:41:01 +02:00
Rename make_float() to multiplyByPowerOfTen()
This commit is contained in:
@@ -192,8 +192,9 @@ struct FloatTraits<T, 4 /*32bits*/> {
|
||||
}
|
||||
};
|
||||
|
||||
// Returns m*10^e
|
||||
template <typename TFloat, typename TExponent>
|
||||
inline TFloat make_float(TFloat m, TExponent e) {
|
||||
inline TFloat multiplyByPowerOfTen(TFloat m, TExponent e) {
|
||||
using traits = FloatTraits<TFloat>;
|
||||
|
||||
auto powersOfTen = e > 0 ? traits::positiveBinaryPowersOfTen()
|
||||
|
||||
@@ -220,12 +220,12 @@ inline Number parseNumber(const char* s) {
|
||||
exponent > FloatTraits<float>::exponent_max ||
|
||||
mantissa > FloatTraits<float>::mantissa_max;
|
||||
if (isDouble) {
|
||||
auto final_result = make_float(double(mantissa), exponent);
|
||||
auto final_result = multiplyByPowerOfTen(double(mantissa), exponent);
|
||||
return Number(is_negative ? -final_result : final_result);
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
auto final_result = make_float(float(mantissa), exponent);
|
||||
auto final_result = multiplyByPowerOfTen(float(mantissa), exponent);
|
||||
return Number(is_negative ? -final_result : final_result);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user