1 // print_float_binary().
7 #include "cln/float_io.h"
12 #include "cln/float.h"
14 #include "cln/integer_io.h"
19 void print_float_binary (std::ostream& stream, const cl_F& z)
21 // Vorzeichen, Punkt, Mantisse (binär), (Zweiersystem-)Exponent (dezimal)
22 cl_idecoded_float m_e_s = integer_decode_float(z);
23 var cl_I& m = m_e_s.mantissa;
24 var cl_I& s = m_e_s.sign;
25 // Vorzeichen ausgeben, falls <0:
27 fprintchar(stream,'-');
28 // Mantisse binär(!) ausgeben:
29 fprintchar(stream,'.');
30 print_integer(stream,2,m);
31 // Exponent-Marker ausgeben:
40 fprintchar(stream,exp_marker);
42 // Exponenten dezimal ausgeben:
43 print_integer(stream,10,cl_I(float_exponent(z)));