Date: Sat, 22 Feb 2003 10:29:35 +1100 From: Tim Robbins <tjr@FreeBSD.org> To: Garrett Wollman <wollman@lcs.mit.edu> Cc: standards@FreeBSD.org Subject: Re: importing gdtoa Message-ID: <20030222102935.A65681@dilbert.robbins.dropbear.id.au> In-Reply-To: <200302211820.h1LIKHhQ013553@khavrinen.lcs.mit.edu>; from wollman@lcs.mit.edu on Fri, Feb 21, 2003 at 01:20:17PM -0500 References: <20030221085508.GA55786@HAL9000.homeunix.com> <20030221203916.A40755@dilbert.robbins.dropbear.id.au> <200302211820.h1LIKHhQ013553@khavrinen.lcs.mit.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Feb 21, 2003 at 01:20:17PM -0500, Garrett Wollman wrote: > <<On Fri, 21 Feb 2003 20:39:16 +1100, Tim Robbins <tjr@FreeBSD.ORG> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030222102935.A65681>