Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 25 Apr 2003 01:40:17 -0700 (PDT)
From:      "Sergey A. Osokin" <osa@freebsd.org.ru>
To:        freebsd-standards@FreeBSD.org
Subject:   Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
Message-ID:  <200304250840.h3P8eHre020968@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR standards/51292; it has been noted by GNATS.

From: "Sergey A. Osokin" <osa@freebsd.org.ru>
To: Alexey Zelkin <phantom@FreeBSD.org.ua>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
Date: Fri, 25 Apr 2003 12:38:51 +0400

 On Fri, Apr 25, 2003 at 12:30:12AM +0300, Alexey Zelkin wrote:
 > hi,
 > 
 > On Wed, Apr 23, 2003 at 12:26:47AM +0400, Sergey A.Osokin wrote:
 > > 
 > > >Number:         51292
 > > >Category:       standards
 > > >Synopsis:       [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
 > 
 > Few questions related to code:
 > 
 > 1. What's a reason to have some LANG handling logic here ?
 
 Because standart says:
 The radix character is determined by the current locale.
 Follow this way: check LANG, then set locale.
  
 > 2. Did you check correctness of dtoa()'s usage here ?  It's not easy
 > and after last netlib's import it become more uneasy.
 
 I create a little test proram:
 ---- test.c ---
 #include <stdio.h>
 #include <stdlib.h>
   
 int main(void)
 {
         char buff[255];
         double value = -1000.010101011;
         char *link;
 
         link = buff;
         gcvt(value, 16, link);
         printf("%s\n", buff);
   
         return 0;
 }
 
 ---- test.c ---
 $ cc -Wall -g 1.c -o 1
 $ LANG=C ./1
 -1000.010101011
 $ LANG=ru_RU.KOI8-R ./1
 -1000,010101011
 
 Looks like it works, isn't it?
 -- 
 
 Rgdz,                        /"\  ASCII RIBBON CAMPAIGN
 Sergey Osokin aka oZZ,       \ /    AGAINST HTML MAIL
 http://ozz.pp.ru/             X          AND NEWS
                              / \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304250840.h3P8eHre020968>