From owner-freebsd-standards Fri Feb 21 15:29:50 2003 Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DE2BF37B401 for ; Fri, 21 Feb 2003 15:29:48 -0800 (PST) Received: from dilbert.robbins.dropbear.id.au (008.b.012.mel.iprimus.net.au [210.50.249.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4317E43FD7 for ; Fri, 21 Feb 2003 15:29:46 -0800 (PST) (envelope-from tim@robbins.dropbear.id.au) Received: from dilbert.robbins.dropbear.id.au (d2p9qfwobb28xpt6@localhost [127.0.0.1]) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6) with ESMTP id h1LNTc2c067540; Sat, 22 Feb 2003 10:29:38 +1100 (EST) (envelope-from tim@dilbert.robbins.dropbear.id.au) Received: (from tim@localhost) by dilbert.robbins.dropbear.id.au (8.12.6/8.12.6/Submit) id h1LNTaKs067539; Sat, 22 Feb 2003 10:29:36 +1100 (EST) (envelope-from tim) Date: Sat, 22 Feb 2003 10:29:35 +1100 From: Tim Robbins To: Garrett Wollman Cc: standards@FreeBSD.org Subject: Re: importing gdtoa Message-ID: <20030222102935.A65681@dilbert.robbins.dropbear.id.au> References: <20030221085508.GA55786@HAL9000.homeunix.com> <20030221203916.A40755@dilbert.robbins.dropbear.id.au> <200302211820.h1LIKHhQ013553@khavrinen.lcs.mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200302211820.h1LIKHhQ013553@khavrinen.lcs.mit.edu>; from wollman@lcs.mit.edu on Fri, Feb 21, 2003 at 01:20:17PM -0500 Sender: owner-freebsd-standards@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, Feb 21, 2003 at 01:20:17PM -0500, Garrett Wollman wrote: > < said: > > > I'll write wcstof() and wcstold() as wrappers around strtof() and > > strtold() and have them ready to commit along with your import > > of gdtoa. > > Is this really the right thing? No, it's the easy way of doing it. The alternative is to duplicate strtod(), change the argument types and call it wcstod(). I think this is what glibc does. NetBSD and Microsoft do it by converting to multibyte strings then calling strtod() (but NetBSD's tries to get too clever and can't convert NaN or Inf). > Is there a mbsto*() set of functions as well, or are the strto*() > functions supposed to be able to deal with that? No, there's no way to convert multibyte strings -> double without converting it to a wide character string first. > We are supposed, I believe, to support arbitrary national digits in > these functions, in addition to the Portable Character Set digits. I haven't checked this yet. I implemented this in wcstol(), wcstoul(), &c. but #ifdef'd it out before committing it. Tim To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-standards" in the body of the message