Re: Float output formatting options - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Float output formatting options
Date
Msg-id 18551.1036433688@sss.pgh.pa.us
Whole thread Raw
In response to Re: Float output formatting options  ("Pedro M. Ferreira" <pfrazao@ualg.pt>)
List pgsql-hackers
"Pedro M. Ferreira" <pfrazao@ualg.pt> writes:
> These functions produce output with (for pair_encode):

> sprintf(str, "%.*g,%.*g", digits8, x, digits8, y);

> digits8 is defined as ,

> #define P_MAXDIG DBL_DIG
> static int      digits8 = P_MAXDIG;

> I think it would be done the same way as for float4_out and float8_out:

Yeah.  In fact I'd be inclined to remove the static variable and make
the code match float8out exactly (do "DBL_DIG + extra_float_digits").

> There a bunch of other places where output is produced. They are all 
> within #ifdef GEODEBUG / #enfif blocks. Should these be corrected the 
> same way ?

Up to you.  Personally I'd just leave them alone...
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Pedro M. Ferreira"
Date:
Subject: Re: Float output formatting options
Next
From: "Pedro M. Ferreira"
Date:
Subject: Re: Float output formatting options