Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Interval aggregate regression failure (expected seems

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Michael Paesold <mpaesold(at)gmx(dot)at>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: [HACKERS] Interval aggregate regression failure (expected seems
Date: 2006-08-30 05:44:42
Message-ID: 4D960AA4-EE5B-4FD7-BE43-06744A2DA7A3@seespotcode.net (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Aug 30, 2006, at 12:50 , Bruce Momjian wrote:

> Here is a test program.  What does it show for you?

> The output for me is:
>
> 	4.100000000000000
> 	2.999999999999989
> 	3.000000000000000

Here's what I get. Just to make sure I'm doing this right, I'm  
including how I compiled it.

$ cat div_test.c
#include <stdio.h>


int
main(int argc, char *argv[])
{
     double x;

     x = 41;
     x = x / 10.0;
     printf("%f\n", x);
     x = x - (int)x;
     x = x * 30;
     printf("%15.15f\n", x);
     x = 0.1 * 30;
     printf("%15.15f\n", x);
     return 0;
}
$ gcc div_test.c -o div_test
$ ./div_test
4.100000
2.999999999999989
3.000000000000000
$

> Yea, just an optimization, but I was worried that the computations  
> might
> throw problems for certain numbers, so I figured I would only  
> trigger it
> when necessary.

Thanks for the explanation. Helps me know I might actually be  
learning this.

> Patch attached.  It also fixes a regression test output too.

Thanks for the patch. I'll look at it more closely tonight.

Michael Glaesemann
grzm seespotcode net


In response to

Responses

pgsql-hackers by date

Next:From: Böszörményi ZoltánDate: 2006-08-30 05:57:53
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO
Previous:From: Joshua D. DrakeDate: 2006-08-30 05:16:30
Subject: Re: TODO Request

pgsql-patches by date

Next:From: Böszörményi ZoltánDate: 2006-08-30 05:57:53
Subject: Re: [HACKERS] Performance testing of COPY (SELECT) TO
Previous:From: Bruce MomjianDate: 2006-08-30 04:22:05
Subject: Re: Interval month, week -> day

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group