MCPcopy Create free account
hub / github.com/Open-GD/OpenGD / adjusted_mantissa digit_comp

Function adjusted_mantissa digit_comp

Source/external/fast_float.h:3086–3103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3084// of both, and use that to direct rounding.
3085template <typename T>
3086inline FASTFLOAT_CONSTEXPR20
3087adjusted_mantissa digit_comp(parsed_number_string& num, adjusted_mantissa am) noexcept {
3088 // remove the invalid exponent bias
3089 am.power2 -= invalid_am_bias;
3090
3091 int32_t sci_exp = scientific_exponent(num);
3092 size_t max_digits = binary_format<T>::max_digits();
3093 size_t digits = 0;
3094 bigint bigmant;
3095 parse_mantissa(bigmant, num, max_digits, digits);
3096 // can't underflow, since digits is at most max_digits.
3097 int32_t exponent = sci_exp + 1 - int32_t(digits);
3098 if (exponent >= 0) {
3099 return positive_digit_comp<T>(bigmant, exponent);
3100 } else {
3101 return negative_digit_comp<T>(bigmant, am, exponent);
3102 }
3103}
3104
3105} // namespace fast_float
3106

Callers

nothing calls this directly

Calls 2

scientific_exponentFunction · 0.85
parse_mantissaFunction · 0.85

Tested by

no test coverage detected