[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
- Subject: standards/51292: [PATCH] add ecvt()/fcvt()/gcvt() functions (SUSv3)
- From: osa at freebsd.org.ru (Sergey A. Osokin)
- Date: Fri Apr 25 01:45:30 2003
The following reply was made to PR standards/51292; it has been noted by GNATS.
From: "Sergey A. Osokin" <osa_(_at_)_freebsd_(_dot_)_org_(_dot_)_ru>
To: Alexey Zelkin <phantom_(_at_)_FreeBSD_(_dot_)_org_(_dot_)_ua>
Cc: FreeBSD-gnats-submit_(_at_)_freebsd_(_dot_)_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
/ \
Visit your host, monkey.org