From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA18367; Mon, 14 Jun 2004 18:25:19 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA18874 for ; Mon, 14 Jun 2004 18:25:17 +0200 (MET DST) Received: from mail1.speakeasy.net (mail1.speakeasy.net [216.254.0.201]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i5EGPFSH022953 for ; Mon, 14 Jun 2004 18:25:16 +0200 Received: (qmail 27849 invoked from network); 14 Jun 2004 16:25:15 -0000 Received: from dialup-4.242.105.64.dial1.seattle1.level3.net (HELO sherlock.localdomain) (shawnw@[4.242.105.64]) (envelope-sender ) by mail1.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 14 Jun 2004 16:25:14 -0000 Received: by sherlock.localdomain (Postfix, from userid 502) id 33F2CFD15; Mon, 14 Jun 2004 09:27:14 -0700 (PDT) Date: Mon, 14 Jun 2004 09:27:14 -0700 From: Shawn Wagner To: caml-list@inria.fr Subject: Re: [Caml-list] string_of_float -> float_of_string locale dependency bug Message-ID: <20040614162714.GN595@speakeasy.org> Mail-Followup-To: caml-list@inria.fr References: <20040614115444.A14769@pauillac.inria.fr> <20040615.002347.94548124.yoriyuki@mbg.ocn.ne.jp> <20040614180420.C28810@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040614180420.C28810@pauillac.inria.fr> User-Agent: Mutt/1.4.2i X-Miltered: at concorde with ID 40CDD16B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; shawnw:01 caml-list:01 locale:01 bug:01 2004:99 locale:01 reinventing:01 floats:01 floats:01 shawnw:01 ctype:01 speakeasy:01 speakeasy:01 0200,:01 routines:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Mon, Jun 14, 2004 at 06:04:20PM +0200, Xavier Leroy wrote: > > Another approach: write own strtod function which doesn't depend on > > the LC_NUMERIC locale. > > Of course, having our own string <-> float conversions would work > around this issue and other issues as well, such as the inability of > the C library functions to print a float *exactly* (i.e. with just > enough decimals that it reads back to the very same float). > > This is no small undertaking, however, and one has a feeling of > reinventing the wheel. > > The ANSI C standard library is quite small to begin with, but the > addition of locales managed to render it even less useful... > While I agree that LC_NUMERIC makes converting floats into strings that are intended to be converted back into floats by other programs a major pain, locales aren't all bad. Adding locale support and ctype.h routines was one of the first things I did for annexlib. Being able to do things like case conversion according to the user's character set is very nice. *braces for people griping about how that's fundamentally broken too* -- Shawn Wagner shawnw@speakeasy.org ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners