From owner-cvs-all@FreeBSD.ORG Sat Jun 28 02:04:22 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18C0F37B401; Sat, 28 Jun 2003 02:04:22 -0700 (PDT) Received: from HAL9000.homeunix.com (ip114.bella-vista.sfo.interquest.net [66.199.86.114]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5B2D543FF7; Sat, 28 Jun 2003 02:04:21 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: from HAL9000.homeunix.com (localhost [127.0.0.1]) by HAL9000.homeunix.com (8.12.9/8.12.9) with ESMTP id h5S94JiP030326; Sat, 28 Jun 2003 02:04:19 -0700 (PDT) (envelope-from das@FreeBSD.org) Received: (from das@localhost) by HAL9000.homeunix.com (8.12.9/8.12.9/Submit) id h5S94JKk030325; Sat, 28 Jun 2003 02:04:19 -0700 (PDT) (envelope-from das@FreeBSD.org) Date: Sat, 28 Jun 2003 02:04:19 -0700 From: David Schultz To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Message-ID: <20030628090418.GA30292@HAL9000.homeunix.com> Mail-Followup-To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org References: <200306280903.h5S936Em045685@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306280903.h5S936Em045685@repoman.freebsd.org> Subject: Re: cvs commit: src/lib/libc/stdio vfscanf.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Jun 2003 09:04:22 -0000 On Sat, Jun 28, 2003, David Schultz wrote: > das 2003/06/28 02:03:05 PDT > > FreeBSD src repository > > Modified files: > lib/libc/stdio vfscanf.c > Log: > Revamp scanf's floating-point-parsing algorithm to support > [+|-]Inf, [+|-]NaN, nan(...), and hexidecimal FP constants. > While here, add %a and %A, which are aliases for %e, and > add support for long doubles. The new code should correctly parse any well-formed floating point number, but if you notice any problems, set (extern int) scanfdebug to 1. This will cause scanf() to dump core if it notices that strtod() disagrees with it about how long the number is. The two are known to disagree in exactly one case, namely, the 'nan(...)' form. POSIX allows any alphanumeric string to appear in the parentheses, but strtod() only accepts hexadecimal as it should. Fortunately, we get correct behavior anyway, since the interpretation of such a sequence is implementation-defined.