Re: float4 regression test failed on linux parisc

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: float4 regression test failed on linux parisc
Date: 2005-02-01 22:06:40
Message-ID: 20050201215826.M59863@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Source: CSV HEAD (As of yesterday)
Platform: HP PARISC (HP 710)
OS: Debian Sarge
File: src/backend/utils/adt/float.c
Change:
CheckFloat4Val(result);
To:
CheckFloat4Val((float4)result);

I tested this on my parisc box and it passed all tests. This could just be an issue with a very old CPU/floating
point unit.

I can send a patch in, but since this seems to work on other platforms, I thought I would ask here first.

Sorry about the cryptic message, it was before my first cup of java.

Jim

------------------------------------------------
Datum
float4div(PG_FUNCTION_ARGS)
{
float4 arg1 = PG_GETARG_FLOAT4(0);
float4 arg2 = PG_GETARG_FLOAT4(1);
double result;

if (arg2 == 0.0)
ereport(ERROR,
(errcode(ERRCODE_DIVISION_BY_ZERO),
errmsg("division by zero")));

/* Do division in float8, then check for overflow */
result = (float8) arg1 / (float8) arg2;

CheckFloat4Val(result);

PG_RETURN_FLOAT4((float4) result);
}

---------- Original Message -----------
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
Cc: "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>
Sent: Tue, 01 Feb 2005 12:06:30 -0500
Subject: Re: [HACKERS] float4 regression test failed on linux parisc

> "Jim Buttafuoco" <jim(at)contactbda(dot)com> writes:
> > I am getting a float4 regression test failure. I have extracted the SQL from both the float4 and float8 tests
below.
> > Both should return NAN
>
> > I looked at the code, The float4div does the operation as float8's then checks the value. The value is a valid
> > float8 NAN. The call to CheckFloat4Val is missing a cast back to float4. If I put the cast in I get the expected
> > results (NAN).
>
> This report is about as clear as mud :-(. What platform is this, and
> what source code change are you proposing *exactly* ?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
------- End of Original Message -------

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Darcy Buskermolen 2005-02-01 22:10:35 Re: FunctionCallN improvement.
Previous Message Oleg Bartunov 2005-02-01 21:30:37 Re: Huge memory consumption during vacuum (v.8.0)