Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-19 08:08:32

0001 // I/O of real numbers.
0002 
0003 #ifndef _CL_REAL_IO_H
0004 #define _CL_REAL_IO_H
0005 
0006 #include "cln/number_io.h"
0007 #include "cln/real.h"
0008 
0009 namespace cln {
0010 
0011 // Input functions
0012 
0013 // The following does strictly the same as the general read_complex.
0014 // It is here only so that you don't need the complex number reader
0015 // in order to read an rational number. ("Treeshaking")
0016 extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
0017 extern const cl_R read_real (std::istream& stream, const cl_read_flags& flags);
0018 
0019 inline std::istream& operator>> (std::istream& stream, cl_R& result)
0020 {
0021     extern cl_read_flags cl_R_read_flags;
0022     result = read_real(stream,cl_R_read_flags);
0023     return stream;
0024 }
0025 
0026 
0027 // Output functions
0028 
0029 // Gibt eine Zahl aus.
0030 // print_real(stream,flags,z);
0031 // > z: Zahl
0032 // > stream: Stream
0033 // > flags: Ausgabe-Parameter
0034 extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
0035 extern void print_real (std::ostream& stream, const cl_print_number_flags& flags, const cl_R& z);
0036 extern void print_real (std::ostream& stream, const cl_print_real_flags& flags, const cl_R& z);
0037 
0038 // The following does strictly the same as the general `fprint' for numbers.
0039 // It is here only so that you don't need the complex number printer
0040 // in order to print an integer. ("Treeshaking")
0041 
0042 inline void fprint (std::ostream& stream, const cl_R& x)
0043 {
0044     extern cl_print_flags default_print_flags;
0045     print_real(stream,default_print_flags,x);
0046 }
0047 
0048 CL_DEFINE_PRINT_OPERATOR(cl_R)
0049 
0050 }  // namespace cln
0051 
0052 #endif /* _CL_REAL_IO_H */