6 #include "cl_number_io.h"
10 // Undocumented input functions
12 // Wandelt eine Zeichenkette mit Float-Syntax in ein Float um.
13 // read_float(base,sign,string,index1,index4,index2,index3)
14 // > base: Lesebasis (=10)
15 // > sign: Vorzeichen (/=0 falls negativ)
16 // > string: Simple-String (enthält Ziffern und evtl. Punkt und Exponentmarker)
17 // > index1: Index vom Mantissenanfang (excl. Vorzeichen)
18 // > index4: Index nach dem Mantissenende
19 // > index2: Index beim Ende der Characters
20 // > index3: Index nach dem Dezimalpunkt (=index4 falls keiner da)
21 // (also Mantisse mit index4-index1 Characters: Ziffern und max. 1 '.')
22 // (also index4-index3 Nachkommaziffern)
23 // (also bei index4<index2: index4 = Index des Exponent-Markers,
24 // index4+1 = Index des Exponenten-Vorzeichens oder der ersten
27 extern const cl_F read_float (unsigned int base, cl_float_format_t prec,
28 cl_signean sign, const char * string, uintL index1, uintL index4, uintL index2, uintL index3);
30 // The following does strictly the same as the general read_complex.
31 // It is here only so that you don't need the complex and rational number
32 // readers in order to read a float number. ("Treeshaking")
33 extern const cl_F read_float (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
34 extern const cl_F read_float (cl_istream stream, const cl_read_flags& flags);
36 // Documented input functions
38 inline cl_istream operator>> (cl_istream stream, cl_F& result)
40 extern cl_read_flags cl_F_read_flags;
41 result = read_float(stream,cl_F_read_flags);
46 // Undocumented output functions
49 // Documented output functions
51 // Gibt ein Float aus.
52 // print_float(stream,z);
55 extern void print_float (cl_ostream stream, const cl_print_flags& flags, const cl_F& z);
56 extern void print_float (cl_ostream stream, const cl_print_number_flags& flags, const cl_F& z);
57 extern void print_float (cl_ostream stream, const cl_print_real_flags& flags, const cl_F& z);
58 extern void print_float (cl_ostream stream, const cl_print_float_flags& flags, const cl_F& z);
60 // Gibt ein Float binär (sehr primitiv) aus.
61 // print_float_binary(stream,z);
64 extern void print_float_binary (cl_ostream stream, const cl_F& z);
66 // The following does strictly the same as the general `fprint' for numbers.
67 // It is here only so that you don't need the complex printer
68 // in order to print a float. ("Treeshaking")
70 inline void fprint (cl_ostream stream, const cl_F& x)
72 extern cl_print_flags cl_default_print_flags;
73 print_float(stream,cl_default_print_flags,x);
76 CL_DEFINE_PRINT_OPERATOR(cl_F)
79 #endif /* _CL_FLOAT_IO_H */