]> www.ginac.de Git - cln.git/blob - include/cl_real_io.h
- autoconf/aclocal.m4 (CL_CANONICAL_HOST): Added missing changequote
[cln.git] / include / cl_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 "cl_number_io.h"
7 #include "cl_real.h"
8
9
10 // Undocumented input functions
11
12 // The following does strictly the same as the general read_complex.
13 // It is here only so that you don't need the complex number reader
14 // in order to read an rational number. ("Treeshaking")
15 extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
16 extern const cl_R read_real (cl_istream stream, const cl_read_flags& flags);
17
18 // Documented input functions
19
20 inline cl_istream operator>> (cl_istream stream, cl_R& result)
21 {
22         extern cl_read_flags cl_R_read_flags;
23         result = read_real(stream,cl_R_read_flags);
24         return stream;
25 }
26
27
28 // Undocumented output functions
29
30
31 // Documented output functions
32
33 // Gibt eine Zahl aus.
34 // print_real(stream,flags,z);
35 // > z: Zahl
36 // > stream: Stream
37 // > flags: Ausgabe-Parameter
38 extern void print_real (cl_ostream stream, const cl_print_flags& flags, const cl_R& z);
39 extern void print_real (cl_ostream stream, const cl_print_number_flags& flags, const cl_R& z);
40 extern void print_real (cl_ostream stream, const cl_print_real_flags& flags, const cl_R& z);
41
42 // The following does strictly the same as the general `fprint' for numbers.
43 // It is here only so that you don't need the complex number printer
44 // in order to print an integer. ("Treeshaking")
45
46 inline void fprint (cl_ostream stream, const cl_R& x)
47 {
48         extern cl_print_flags cl_default_print_flags;
49         print_real(stream,cl_default_print_flags,x);
50 }
51
52 CL_DEFINE_PRINT_OPERATOR(cl_R)
53
54
55 #endif /* _CL_REAL_IO_H */