]> www.ginac.de Git - cln.git/blob - include/cln/real_io.h
* include/cln/object.h (cl_combine): define additional signatures, if
[cln.git] / include / cln / real_io.h
1 // I/O of real numbers.
2
3 #ifndef _CL_REAL_IO_H
4 #define _CL_REAL_IO_H
5
6 #include "cln/number_io.h"
7 #include "cln/real.h"
8
9 namespace cln {
10
11 // Undocumented input functions
12
13 // The following does strictly the same as the general read_complex.
14 // It is here only so that you don't need the complex number reader
15 // in order to read an rational number. ("Treeshaking")
16 extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
17 extern const cl_R read_real (cl_istream stream, const cl_read_flags& flags);
18
19 // Documented input functions
20
21 inline cl_istream operator>> (cl_istream stream, cl_R& result)
22 {
23         extern cl_read_flags cl_R_read_flags;
24         result = read_real(stream,cl_R_read_flags);
25         return stream;
26 }
27
28
29 // Undocumented output functions
30
31
32 // Documented output functions
33
34 // Gibt eine Zahl aus.
35 // print_real(stream,flags,z);
36 // > z: Zahl
37 // > stream: Stream
38 // > flags: Ausgabe-Parameter
39 extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
40 extern void print_real (cl_ostream stream, const cl_print_number_flags& flags, const cl_R& z);
41 extern void print_real (cl_ostream stream, const cl_print_real_flags& flags, const cl_R& z);
42
43 // The following does strictly the same as the general `fprint' for numbers.
44 // It is here only so that you don't need the complex number printer
45 // in order to print an integer. ("Treeshaking")
46
47 inline void fprint (cl_ostream stream, const cl_R& x)
48 {
49         extern cl_print_flags default_print_flags;
50         print_real(stream,default_print_flags,x);
51 }
52
53 CL_DEFINE_PRINT_OPERATOR(cl_R)
54
55 }  // namespace cln
56
57 #endif /* _CL_REAL_IO_H */