Re: Float output formatting options
От | Pedro M. Ferreira |
---|---|
Тема | Re: Float output formatting options |
Дата | |
Msg-id | 3DC691CE.6070408@ualg.pt обсуждение исходный текст |
Ответ на | Float output formatting options ("Pedro M. Ferreira" <pfrazao@ualg.pt>) |
Ответы |
Re: Float output formatting options
|
Список | pgsql-hackers |
Tom Lane wrote: > "Pedro M. Ferreira" <pfrazao@ualg.pt> writes: > >>int extra_float4_digits, default 0, min -4, max 2 >>int extra_float8_digits, defualt 0, min -13, max 2 > > > I think a single setting extra_float_digits would be sufficient. Ok. Assuming, int extra_float_digits, default 0, min -13, max 2 If extra_float_digits==-13 and we are outputing a float4 this results in a negative value for FLT_DIG+extra_float_digits. I dont know if sprintf's behaviour is the same across different libraries for this situation. Should I include the following to handle this case ? if(extra_float_digits<-4) sprintf(ascii, "%.*g", FLT_DIG-4, num); else sprintf(ascii, "%.*g", FLT_DIG+extra_float_digits, num); > > >>Also, if we concluded that there is a need of 2 more digits, should'nt >>this be the default ? > > > No. pg_dump would want to bump it up on-the-fly. > > regards, tom lane > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > > -- ---------------------------------------------------------------------- Pedro Miguel Frazao Fernandes Ferreira Universidade do Algarve Faculdade de Ciencias e Tecnologia Campus de Gambelas 8000-117 Faro Portugal Tel./Fax: (+351) 289 800950 / 289 819403 http://w3.ualg.pt/~pfrazao
В списке pgsql-hackers по дате отправления: