// General includes.
#include "cl_sysdep.h"
-CL_PROVIDE(cl_fmt_scaleexp)
-
// Specification.
#include "cl_format.h"
: zero(a), one(b), ten(c), tenth(d), lg2(e) {}
};
-static const cl_RA tenth = (cl_RA)"1/10";
-static const cl_SF SF_zero = cl_RA_to_SF(0);
-static const cl_SF SF_one = cl_RA_to_SF(1);
-static const cl_SF SF_ten = cl_RA_to_SF(10);
-static const cl_SF SF_tenth = cl_RA_to_SF(tenth);
-static const cl_FF FF_zero = cl_RA_to_FF(0);
-static const cl_FF FF_one = cl_RA_to_FF(1);
-static const cl_FF FF_ten = cl_RA_to_FF(10);
-static const cl_FF FF_tenth = cl_RA_to_FF(tenth);
-static const cl_DF DF_zero = cl_RA_to_DF(0);
-static const cl_DF DF_one = cl_RA_to_DF(1);
-static const cl_DF DF_ten = cl_RA_to_DF(10);
-static const cl_DF DF_tenth = cl_RA_to_DF(tenth);
-static const cl_SF SF_lg2 = (cl_SF)"0.30103";
-static const cl_DF DF_lg2 = (cl_DF)"0.30102999566";
-
static const float_format_params get_float_params (const cl_F& arg)
{
+ static const cl_RA tenth = (cl_RA)"1/10";
+ static const cl_SF SF_zero = cl_RA_to_SF(0);
+ static const cl_SF SF_one = cl_RA_to_SF(1);
+ static const cl_SF SF_ten = cl_RA_to_SF(10);
+ static const cl_SF SF_tenth = cl_RA_to_SF(tenth);
+ static const cl_FF FF_zero = cl_RA_to_FF(0);
+ static const cl_FF FF_one = cl_RA_to_FF(1);
+ static const cl_FF FF_ten = cl_RA_to_FF(10);
+ static const cl_FF FF_tenth = cl_RA_to_FF(tenth);
+ static const cl_DF DF_zero = cl_RA_to_DF(0);
+ static const cl_DF DF_one = cl_RA_to_DF(1);
+ static const cl_DF DF_ten = cl_RA_to_DF(10);
+ static const cl_DF DF_tenth = cl_RA_to_DF(tenth);
+ static const cl_SF SF_lg2 = (cl_SF)"0.30103";
+ static const cl_DF DF_lg2 = (cl_DF)"0.30102999566";
+
floattypecase(arg
, return float_format_params(SF_zero,SF_one,SF_ten,SF_tenth,SF_lg2);
, return float_format_params(FF_zero,FF_one,FF_ten,FF_tenth,SF_lg2);
} // namespace cln
-CL_PROVIDE_END(cl_fmt_scaleexp)
// arg = mantissa * 10^n * sign (also 10^(n-1) <= abs(arg) < 10^n ).
// (Bei arg=0.0: 0.0 und n=0.)
extern const decoded_float format_scale_exponent (const cl_F& arg);
-CL_REQUIRE(cl_fmt_scaleexp)
// format_float_to_string(arg,width,d,k,dmin)
// ergibt einen String zum Floating-point arg:
: string(s), length(l), dot_comes_first(df), dot_comes_last(dl), dot_position(dp) {}
};
extern const digits_with_dot format_float_to_string (const cl_F& arg, const sintL width, const sintL d, const sintL k, const sintL dmin);
-CL_REQUIRE(cl_fmt_floatstring)
} // namespace cln