You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.6 KiB

25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
25 years ago
  1. // I/O of real numbers.
  2. #ifndef _CL_REAL_IO_H
  3. #define _CL_REAL_IO_H
  4. #include "cln/number_io.h"
  5. #include "cln/real.h"
  6. namespace cln {
  7. // Undocumented input functions
  8. // The following does strictly the same as the general read_complex.
  9. // It is here only so that you don't need the complex number reader
  10. // in order to read an rational number. ("Treeshaking")
  11. extern const cl_R read_real (const cl_read_flags& flags, const char * string, const char * string_limit, const char * * end_of_parse);
  12. extern const cl_R read_real (std::istream& stream, const cl_read_flags& flags);
  13. // Documented input functions
  14. inline std::istream& operator>> (std::istream& stream, cl_R& result)
  15. {
  16. extern cl_read_flags cl_R_read_flags;
  17. result = read_real(stream,cl_R_read_flags);
  18. return stream;
  19. }
  20. // Undocumented output functions
  21. // Documented output functions
  22. // Gibt eine Zahl aus.
  23. // print_real(stream,flags,z);
  24. // > z: Zahl
  25. // > stream: Stream
  26. // > flags: Ausgabe-Parameter
  27. extern void print_real (std::ostream& stream, const cl_print_flags& flags, const cl_R& z);
  28. extern void print_real (std::ostream& stream, const cl_print_number_flags& flags, const cl_R& z);
  29. extern void print_real (std::ostream& stream, const cl_print_real_flags& flags, const cl_R& z);
  30. // The following does strictly the same as the general `fprint' for numbers.
  31. // It is here only so that you don't need the complex number printer
  32. // in order to print an integer. ("Treeshaking")
  33. inline void fprint (std::ostream& stream, const cl_R& x)
  34. {
  35. extern cl_print_flags default_print_flags;
  36. print_real(stream,default_print_flags,x);
  37. }
  38. CL_DEFINE_PRINT_OPERATOR(cl_R)
  39. } // namespace cln
  40. #endif /* _CL_REAL_IO_H */