25 lines
466 B

25 years ago
25 years ago
25 years ago
  1. // read_integer().
  2. // General includes.
  3. #include "cl_sysdep.h"
  4. // Specification.
  5. #include "cln/integer_io.h"
  6. // Implementation.
  7. #include "cl_I.h"
  8. namespace cln {
  9. const cl_I read_integer (unsigned int base, cl_signean sign, const char * string, uintC index1, uintC index2)
  10. {
  11. var cl_I x = digits_to_I(&string[index1],index2-index1,(uintD)base);
  12. if (sign == 0)
  13. return x;
  14. else
  15. return -x; // negatives Vorzeichen -> Vorzeichenwechsel
  16. }
  17. } // namespace cln