Mercurial > hg > xemacs-beta
comparison src/number.c @ 2013:f2fdfc131770
[xemacs-hg @ 2004-04-14 22:50:52 by james]
Work around GMP string to number limitations.
author | james |
---|---|
date | Wed, 14 Apr 2004 22:50:54 +0000 |
parents | a9cdbfb4716e |
children | 4db90be29229 |
comparison
equal
deleted
inserted
replaced
2012:dd25e95fdbe1 | 2013:f2fdfc131770 |
---|---|
83 | 83 |
84 Lisp_Object | 84 Lisp_Object |
85 string_to_bignum (const Ibyte *str, Bytecount len, int base) | 85 string_to_bignum (const Ibyte *str, Bytecount len, int base) |
86 { | 86 { |
87 Lisp_Object b = make_bignum (0L); | 87 Lisp_Object b = make_bignum (0L); |
88 /* GMP bignum_set_string returns random values with initial + sign */ | 88 /* GMP bignum_set_string has no effect with initial + sign */ |
89 if (*str == '+') | 89 if (*str == '+') |
90 str++; | 90 str++; |
91 /* GMP bignum_set_string returns random values when fed an empty string */ | 91 /* GMP bignum_set_string has no effect when fed an empty string */ |
92 if (*str == '\0') | 92 if (*str == '\0') |
93 return make_int (0); | 93 return make_int (0); |
94 return (bignum_set_string (XBIGNUM_DATA (b), (const char *) str, base) < 0) | 94 return (bignum_set_string (XBIGNUM_DATA (b), (const char *) str, base) < 0) |
95 ? Fsignal (Qinvalid_read_syntax, | 95 ? Fsignal (Qinvalid_read_syntax, |
96 list3 (build_msg_string | 96 list3 (build_msg_string |