Re: [pgsql-patches] [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling

2007-01-24 Thread Roman Kononov
On 12/27/2006 01:15 PM, Tom Lane wrote: I'm not convinced that you're fixing things so much as doing your best to destroy IEEE-compliant float arithmetic behavior. I think what we should probably consider is removing CheckFloat4Val and CheckFloat8Val altogether, and just letting the float arithm

Re: [HACKERS] [PATCHES] [BUGS] BUG #2846: inconsistent and confusing

2006-12-29 Thread Roman Kononov
On 12/29/2006 11:27 AM, Tom Lane wrote: Doesn't even compile here (no ). Where do you compile? Roman ---(end of broadcast)--- TIP 6: explain analyze is your friend

Re: [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling of underflows,

2006-12-29 Thread Roman Kononov
On 12/27/2006 12:44 PM, Bruce Momjian wrote: The only unsolved issue is the one with underflow checks. I have added comments explaining the problem in case someone ever figures out how to address it. This will behave better for float4: Datum float4pl(PG_FUNCTION_ARGS) { ---float4 a

Re: [HACKERS] [PATCHES] [BUGS] BUG #2846: inconsistent and confusing

2006-12-29 Thread Roman Kononov
On 12/29/2006 12:23 AM, Bruce Momjian wrote: Well, then show me what direction you think is better. Think about this idea please. This has no INF, NaN or range checks and detects all "bad" cases with any floating point math. The only issue is that a bad case is detected only once. You need to

Re: [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling

2006-12-27 Thread Roman Kononov
On 12/27/2006 05:19 PM, Tom Lane wrote: Roman Kononov <[EMAIL PROTECTED]> writes: On 12/27/2006 03:23 PM, Bruce Momjian wrote: Are you sure? As I remember, computation automatically upgrades to 'double'. See this program and output: This is platform- and compiler- depe

Re: [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling of underflows,

2006-12-27 Thread Roman Kononov
On 12/27/2006 04:04 PM, Bruce Momjian wrote: Interesting. I didn't know that, but in the float4pl() function, because the overflow tests and result is float4, what value is there to doing things as double --- as soon as the float4 maximum is exceeded, we throw an error? This is useful for und

Re: [PATCHES] [BUGS] BUG #2846: inconsistent and confusing handling of underflows,

2006-12-27 Thread Roman Kononov
On 12/27/2006 03:23 PM, Bruce Momjian wrote: Are you sure? As I remember, computation automatically upgrades to 'double'. See this program and output: This is platform- and compiler- dependent: ~>uname -a Linux rklinux 2.6.15-27-amd64-generic #1 SMP PREEMPT Fri Dec 8 17:50:54 UTC 2006 x86_6