MCPcopy Create free account
hub / github.com/numpy/numpy / Format_floatbits

Function Format_floatbits

numpy/core/src/multiarray/dragon4.c:2182–2202  ·  view source on GitHub ↗

* Helper function that takes Dragon4 parameters and options and * calls Dragon4. */

Source from the content-addressed store, hash-verified

2180 * calls Dragon4.
2181 */
2182static npy_uint32
2183Format_floatbits(char *buffer, npy_uint32 bufferSize, BigInt *mantissa,
2184 npy_int32 exponent, char signbit, npy_uint32 mantissaBit,
2185 npy_bool hasUnequalMargins, Dragon4_Options *opt)
2186{
2187 /* format the value */
2188 if (opt->scientific) {
2189 return FormatScientific(buffer, bufferSize, mantissa, exponent,
2190 signbit, mantissaBit, hasUnequalMargins,
2191 opt->digit_mode, opt->precision,
2192 opt->min_digits, opt->trim_mode,
2193 opt->digits_left, opt->exp_digits);
2194 }
2195 else {
2196 return FormatPositional(buffer, bufferSize, mantissa, exponent,
2197 signbit, mantissaBit, hasUnequalMargins,
2198 opt->digit_mode, opt->cutoff_mode,
2199 opt->precision, opt->min_digits, opt->trim_mode,
2200 opt->digits_left, opt->digits_right);
2201 }
2202}
2203
2204/*
2205 * IEEE binary16 floating-point format

Calls 2

FormatScientificFunction · 0.85
FormatPositionalFunction · 0.85

Tested by

no test coverage detected