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.

55 lines
1.6 KiB

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