MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/Falcor / digit_comp

Function digit_comp

external/include/fast_float/fast_float.h:2847–2863  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2845// of both, and use that to direct rounding.
2846template <typename T>
2847inline adjusted_mantissa digit_comp(parsed_number_string& num, adjusted_mantissa am) noexcept {
2848 // remove the invalid exponent bias
2849 am.power2 -= invalid_am_bias;
2850
2851 int32_t sci_exp = scientific_exponent(num);
2852 size_t max_digits = binary_format<T>::max_digits();
2853 size_t digits = 0;
2854 bigint bigmant;
2855 parse_mantissa(bigmant, num, max_digits, digits);
2856 // can't underflow, since digits is at most max_digits.
2857 int32_t exponent = sci_exp + 1 - int32_t(digits);
2858 if (exponent >= 0) {
2859 return positive_digit_comp<T>(bigmant, exponent);
2860 } else {
2861 return negative_digit_comp<T>(bigmant, am, exponent);
2862 }
2863}
2864
2865} // namespace fast_float
2866

Callers

nothing calls this directly

Calls 2

scientific_exponentFunction · 0.85
parse_mantissaFunction · 0.85

Tested by

no test coverage detected