/* Primitive operations on Lisp data types for GNU Emacs Lisp interpreter.
Copyright (C) 1985, 1986, 1988, 1993, 1994, 1995, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
This file is part of GNU Emacs.
CHECK_SYMBOL (variable);
sym = indirect_variable (XSYMBOL (variable));
XSETSYMBOL (variable, sym);
-
+
valcontents = sym->value;
if (BUFFER_LOCAL_VALUEP (valcontents))
{
DEFUN ("string-to-number", Fstring_to_number, Sstring_to_number, 1, 2, 0,
doc: /* Parse STRING as a decimal number and return the number.
This parses both integers and floating point numbers.
-It ignores leading spaces and tabs.
+It ignores leading spaces and tabs, and all trailing chars.
If BASE, interpret STRING as a number in that base. If BASE isn't
present, base 10 is used. BASE must be between 2 and 16 (inclusive).
-If the base used is not 10, floating point is not recognized. */)
+If the base used is not 10, STRING is always parsed as integer. */)
(string, base)
register Lisp_Object string, base;
{
else if (*p == '+')
p++;
- if (isfloat_string (p) && b == 10)
+ if (isfloat_string (p, 1) && b == 10)
val = make_float (sign * atof (p));
else
{