6 #include "cln/number_io.h"
11 // Undocumented input functions
13 // Wandelt eine Zeichenkette mit Float-Syntax in ein Float um.
14 // read_float(base,sign,string,index1,index4,index2,index3)
15 // > base: Lesebasis (=10)
16 // > sign: Vorzeichen (/=0 falls negativ)
17 // > string: Simple-String (enthält Ziffern und evtl. Punkt und Exponentmarker)
18 // > index1: Index vom Mantissenanfang (excl. Vorzeichen)
19 // > index4: Index nach dem Mantissenende
20 // > index2: Index beim Ende der Characters
21 // > index3: Index nach dem Dezimalpunkt (=index4 falls keiner da)
22 // (also Mantisse mit index4-index1 Characters: Ziffern und max. 1 '.')
23 // (also index4-index3 Nachkommaziffern)
24 // (also bei index4<index2: index4 = Index des Exponent-Markers,
25 // index4+1 = Index des Exponenten-Vorzeichens oder der ersten
28 extern const cl_F read_float (unsigned int base, float_format_t prec,
29 cl_signean sign, const char * string, uintC index1, uintC index4, uintC index2, uintC index3);
31 // The following does strictly the same as the general read_complex.
32 // It is here only so that you don't need the complex and rational number
33 // readers in order to read a float number. ("Treeshaking")
34 extern const cl_F read_float (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
35 extern const cl_F read_float (std::istream& stream, const cl_read_flags& flags);
37 // Documented input functions
39 inline std::istream& operator>> (std::istream& stream, cl_F& result)
41 extern cl_read_flags cl_F_read_flags;
42 result = read_float(stream,cl_F_read_flags);
47 // Undocumented output functions
50 // Documented output functions
52 // Gibt ein Float aus.
53 // print_float(stream,z);
56 extern void print_float (std::ostream& stream, const cl_print_flags& flags, const cl_F& z);
57 extern void print_float (std::ostream& stream, const cl_print_number_flags& flags, const cl_F& z);
58 extern void print_float (std::ostream& stream, const cl_print_real_flags& flags, const cl_F& z);
59 extern void print_float (std::ostream& stream, const cl_print_float_flags& flags, const cl_F& z);
61 // Gibt ein Float binär (sehr primitiv) aus.
62 // print_float_binary(stream,z);
65 extern void print_float_binary (std::ostream& stream, const cl_F& z);
67 // The following does strictly the same as the general `fprint' for numbers.
68 // It is here only so that you don't need the complex printer
69 // in order to print a float. ("Treeshaking")
71 inline void fprint (std::ostream& stream, const cl_F& x)
73 extern cl_print_flags default_print_flags;
74 print_float(stream,default_print_flags,x);
77 CL_DEFINE_PRINT_OPERATOR(cl_F)
81 #endif /* _CL_FLOAT_IO_H */