Re: Float output formatting options
От | Pedro M. Ferreira |
---|---|
Тема | Re: Float output formatting options |
Дата | |
Msg-id | 3DC6C1BE.4060707@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: > >>Is it ok to remove #define P_MAXDIG DBL_DIG, >>change P_MAXLEN to 2*(DBL_DIG+7)+1) and >>remove the line 'static int digits8 = P_MAXDIG;' ? > > Perhaps P_MAXLEN now needs to be (2*(DBL_DIG+2+7)+1), considering > that we'll allow extra_float_digits to be up to 2. What's it used for? Yes. I guess so, because it is used in what I think is a memory allocation function. P_MAXLEN is only used twice: * 1st use in path_encode() (allmost all the geo *_out functions use path_encode): int size = npts * (P_MAXLEN + 3) + 2; /* Check for integer overflow */ if ((size - 2) / npts != (P_MAXLEN + 3)) elog(ERROR, "Too many points requested"); * 2nd use in circle_out(PG_FUNCTION_ARGS): result = palloc(3 * (P_MAXLEN + 1) + 3); I will do the changes tomorrow and send in the appropriate diff's. Regards, Pedro
В списке pgsql-hackers по дате отправления: