Re: BUG #2037: user function call unexpected "input out of range" - Mailing list pgsql-bugs

From tomas@tuxteam.de (Tomas Zerolo)
Subject Re: BUG #2037: user function call unexpected "input out of range"
Date
Msg-id 20051112170817.GA11828@www.trapp.net
Whole thread Raw
In response to BUG #2037: user function call unexpected "input out of range"  ("Tom" <lackey@ltu.edu>)
List pgsql-bugs
On Fri, Nov 11, 2005 at 09:26:47PM +0000, Tom wrote:
>=20
> The following bug has been logged online:
>=20
> Bug reference:      2037
> Logged by:          Tom
> Email address:      lackey@ltu.edu
> PostgreSQL version: 8.1-beta4
> Operating system:   Windows XP
> Description:        user function call unexpected "input out of range"
> Details:=20

[ basically acos(sin(w1)*sin(w2) + cos(w1)*cos(w2)*cos(l1-l2)) ]

Seems to me that you are hitting an unfortunate roundoff error, where
the argument to acos is slightly greater than 1 (it will be
mathematically 1 in the case w1=3D=3Dw2 and l1=3D=3Dl2).

Maybe you should limit the argument to acos to -1..+1?

regards
-- tom=C3=A1s

pgsql-bugs by date:

Previous
From: "Qingqing Zhou"
Date:
Subject: Re: storage sync failed on magnetic disk: Permission denied
Next
From: Bruno Wolff III
Date:
Subject: Re: BUG #2037: user function call unexpected "input out of range"