Mercurial > emacs
comparison src/data.c @ 23420:460aba3ec682
(Fstring_to_number): Don't recognize floating point if base is not 10.
| author | Kenichi Handa <handa@m17n.org> |
|---|---|
| date | Mon, 12 Oct 1998 11:54:43 +0000 |
| parents | ec2d671b77ba |
| children | 3ae4cc2b716c |
comparison
equal
deleted
inserted
replaced
| 23419:c251dd6b289e | 23420:460aba3ec682 |
|---|---|
| 2106 This parses both integers and floating point numbers.\n\ | 2106 This parses both integers and floating point numbers.\n\ |
| 2107 It ignores leading spaces and tabs.\n\ | 2107 It ignores leading spaces and tabs.\n\ |
| 2108 \n\ | 2108 \n\ |
| 2109 If BASE, interpret STRING as a number in that base. If BASE isn't\n\ | 2109 If BASE, interpret STRING as a number in that base. If BASE isn't\n\ |
| 2110 present, base 10 is used. BASE must be between 2 and 16 (inclusive).\n\ | 2110 present, base 10 is used. BASE must be between 2 and 16 (inclusive).\n\ |
| 2111 Floating point numbers always use base 10.") | 2111 If the base used is not 10, floating point is not recognized.") |
| 2112 (string, base) | 2112 (string, base) |
| 2113 register Lisp_Object string, base; | 2113 register Lisp_Object string, base; |
| 2114 { | 2114 { |
| 2115 register unsigned char *p; | 2115 register unsigned char *p; |
| 2116 register int b, digit, v = 0; | 2116 register int b, digit, v = 0; |
| 2142 } | 2142 } |
| 2143 else if (*p == '+') | 2143 else if (*p == '+') |
| 2144 p++; | 2144 p++; |
| 2145 | 2145 |
| 2146 #ifdef LISP_FLOAT_TYPE | 2146 #ifdef LISP_FLOAT_TYPE |
| 2147 if (isfloat_string (p)) | 2147 if (isfloat_string (p) && b == 10) |
| 2148 return make_float (negative * atof (p)); | 2148 return make_float (negative * atof (p)); |
| 2149 #endif /* LISP_FLOAT_TYPE */ | 2149 #endif /* LISP_FLOAT_TYPE */ |
| 2150 | 2150 |
| 2151 while (1) | 2151 while (1) |
| 2152 { | 2152 { |
