From owner-freebsd-current@FreeBSD.ORG Thu May 13 19:14:29 2004 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0409F16A4CE for ; Thu, 13 May 2004 19:14:29 -0700 (PDT) Received: from lerami.lerctr.org (lerami.lerctr.org [192.147.25.11]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7880143D31 for ; Thu, 13 May 2004 19:14:28 -0700 (PDT) (envelope-from ler@lerctr.org) Received: from lerlaptop.lerctr.org ([192.147.25.14]) by lerami.lerctr.org with asmtp (Exim 4.34) id 1BOSDT-0001SF-6U for freebsd-current@freebsd.org; Thu, 13 May 2004 21:14:27 -0500 Date: Thu, 13 May 2004 21:14:26 -0500 From: Larry Rosenman To: freebsd-current@freebsd.org Message-ID: <9AE9B859FD197218F21D81D0@lerlaptop.lerctr.org> X-Mailer: Mulberry/3.1.3 (Linux/x86) X-PGP-Info: All other keys are old/dead. X-PGP-Key: 0x3c49bdd6 X-PGP-Fingerprint: D0D1 3C11 F42F 6B29 FA67 6BF3 AD13 4685 3C49 BDD6 MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="==========53BD2A4CBBAC142EBCDC==========" Subject: strtod vs NAN? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2004 02:14:29 -0000 --==========53BD2A4CBBAC142EBCDC========== Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Isn't strtod supposed to deal with NAN's? I ran: $ cat test3.c #include #include #include int main(int argc,char **argv) { double num; char *input=3D"NAN"; char *border1=3D"/////////////////////////////"; char *input2=3D"inf"; char *border2=3D"/////////////////////////////"; char **ptr; num=3Dstrtod(input,ptr); printf("num=3D%g\n",num); printf("errno=3D%ld\n",errno); printf("ptr=3D%p, points to %s\n",*ptr,*ptr); num=3Dstrtod(input2,ptr); printf("num=3D%g\n",num); printf("errno=3D%ld\n",errno); printf("ptr=3D%p, points to %s\n",*ptr,*ptr); exit(0); } $ and I get a SIGSEGV in the first strtod call. the manpage for strtod implies, to me, that it should deal with it. Thanks! This is with -CURRENT as of: $ uname -a FreeBSD lerlaptop.lerctr.org 5.2-CURRENT FreeBSD 5.2-CURRENT #111: Sat May=20 1 23:09:13 CDT 2004=20 ler@lerlaptop.lerctr.org:/usr/obj/usr/src/sys/LERLAPTOP i386 $ --=20 Larry Rosenman http://www.lerctr.org/~ler Phone: +1 972-414-9812 E-Mail: ler@lerctr.org US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749 --==========53BD2A4CBBAC142EBCDC========== Content-Type: application/pgp-signature Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFApCuCrRNGhTxJvdYRAptCAJ9/f3hRvwZuIuL0IEgr40qKeKOfdwCeP9q1 nRsTsiHoE3JRb4Ps5BkDJMA= =+90n -----END PGP SIGNATURE----- --==========53BD2A4CBBAC142EBCDC==========--