unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: jay.p.belanger@gmail.com
Cc: 16293@debbugs.gnu.org
Subject: bug#16293: 24.3.50; doc of `string-to-number'
Date: Sun, 29 Dec 2013 16:03:29 -0800 (PST)	[thread overview]
Message-ID: <e28355f9-36a1-42df-82ee-1f8a1ce90d20@default> (raw)
In-Reply-To: <87sitb9q6n.fsf@gmail.com>

> >> > Say what happens if STRING cannot successfully be parsed as a number:
> >> > the function raises an error.
> >>
> >> When would it give an error, rather than 0?
> >
> > If it never raises an error, then say explicitly that for any
> > string that cannot successfully be parsed as a number it returns 0.
> 
> It does say:
>      If the first character after the ignored whitespace is neither a
>      digit in the given base, nor a plus or minus sign, nor the leading
>      dot of a floating point number, this function returns 0.
>
> Should this be reworded, or perhaps moved to earlier in the
> documentation?

It should be corrected to be more complete.  It's not just about the
first character.  Any string of characters that cannot be successfully
parsed as a number results in a return value of zero (apparently - I
have not checked the code).  "+@", for instance.
 





  parent reply	other threads:[~2013-12-30  0:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 22:20 bug#16293: 24.3.50; doc of `string-to-number' Drew Adams
2013-12-29 22:47 ` Jay Belanger
2013-12-29 23:07   ` Drew Adams
     [not found]     ` <87sitb9q6n.fsf@gmail.com>
2013-12-30  0:03       ` Drew Adams [this message]
2014-01-05  1:25 ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e28355f9-36a1-42df-82ee-1f8a1ce90d20@default \
    --to=drew.adams@oracle.com \
    --cc=16293@debbugs.gnu.org \
    --cc=jay.p.belanger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).