* Helper function that takes Dragon4 parameters and options and * calls Dragon4. */
| 2180 | * calls Dragon4. |
| 2181 | */ |
| 2182 | static npy_uint32 |
| 2183 | Format_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 |
no test coverage detected