9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] ape strtod crash
Date: Thu, 30 Jul 2009 09:25:00 -0400	[thread overview]
Message-ID: <99a67247ca7b81245f609d3f68a4cd21@quanstro.net> (raw)
In-Reply-To: <df49a7370907300516r251a7a40ld597478fee081936@mail.gmail.com>

On Thu Jul 30 08:18:45 EDT 2009, rogpeppe@gmail.com wrote:
> 2009/7/30 erik quanstrom <quanstro@quanstro.net>:
> > fixed,
> >
> > http://9fans.net/archive/2009/01/234
>
> ok, thanks, i had a very vague memory of this, but obviously
> my googling was inadequate.
>
> did you submit a patch? i can't see one.
> i will if not - it's an annoying error.

i'm sorry.  i wasn't sure this patch met the standards,
and then i forgot about it.  i've found that patches
like this are hard to go far enough yet not go too
far.

/n/sources/patch/apestrtod.

here's a demonstration of the fix.  awk is sufficient
to demonstrate the problem with the number you mention.

; echo 421567849e316 | /n/sources/plan9/386/bin/awk '{print}'
421567849e316
; 9fs sources
; ; echo 421567849e316 | /n/sources/plan9/386/bin/awk '{print}'
/n/sources/plan9/386/bin/awk: floating point exception 6
 source line 1

>
> (and, as you say, why not just use the usual strtod?)
>

a partial answer is in /sys/src/ape/lib/fmt/strtod.c's comments.
there are cases were ERANGE is appropriate in unix land.

this is the hard question.  perhaps dumping ape stdio's strtod
and editing the usual one to fit unix's model would be the right
plan.

- erik



  reply	other threads:[~2009-07-30 13:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  8:40 roger peppe
2009-07-30 11:29 ` erik quanstrom
2009-07-30 12:16   ` roger peppe
2009-07-30 13:25     ` erik quanstrom [this message]
2009-07-30 13:30       ` erik quanstrom

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

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

  git send-email \
    --in-reply-to=99a67247ca7b81245f609d3f68a4cd21@quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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.
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 NNTP newsgroup(s).