emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

string-to-number full behavior not mentioned in the docstring


From: Mathias Dahl
Subject: string-to-number full behavior not mentioned in the docstring
Date: Thu, 13 Jul 2006 08:42:30 +0200

I just tested `string-to-number':

(string-to-number "1234")
 => 1234

(string-to-number "12XYZ34")
 => 12

(string-to-number "1234XYZ")
 => 1234

The docstring says:

--
(string-to-number string &optional base)

Parse string as a decimal number and return the number.
This parses both integers and floating point numbers.
It ignores leading spaces and tabs.

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.
--

The behavior above is not explained. I checked the Elisp manual and it
*is* mentioned there. Shouldn't the behavior be mentioned in the
docstring too? The text from the manual isn't that long.

I know I know, we cannot document everything in the docstrings, but in
this case I think it is short enough to include.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]