Re: Problem in

From: Javin Paul <savingfunda(at)gmail(dot)com>
To: Max Lipsky <maxlipsky(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-sql(at)lists(dot)postgresql(dot)org
Subject: Re: Problem in
Date: 2019-05-18 03:13:31
Message-ID: CAKGadqYnnvkiiR5cJXxJW1_3=sbr-g2xy455FA=XMDMr86We_A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hello All,

I want to unsubscribe from this group, can anyone please guide? Sorry for
the trouble.

Regards
Javin

On Fri, Apr 26, 2019 at 3:24 PM Max Lipsky <maxlipsky(at)gmail(dot)com> wrote:

> Hello Tom!
>
> I think is too much for roundoff error
>
> Found funny post about it:
>
> https://randomascii.wordpress.com/2014/10/09/intel-underestimates-error-bounds-by-1-3-quintillion/
> http://notabs.org/fpuaccuracy/index.htm
>
>
>
> On 25 Apr 2019, at 19:56, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Max Lipsky <maxlipsky(at)gmail(dot)com> writes:
>
> SELECT acos(
> cos(radians(48.9193))
> * cos(radians(48.9193))
> * cos(radians(2.5431) - radians(2.5431))
> + sin(radians(48.9193))
> * sin(radians(48.9193))
> ) as result;
>
>
> This returned [22003] ERROR: input is out of range
>
>
> Not too surprising, because (at least on my machine)
>
> regression=# select cos(radians(48.9193))
> regression-# * cos(radians(48.9193)) + sin(radians(48.9193))
> regression-# * sin(radians(48.9193));
> ?column?
> --------------------
> 1.0000000000000002
> (1 row)
>
> Problems of this sort are inevitable when working with finite-precision
> math.
>
> https://en.wikipedia.org/wiki/Round-off_error
>
> regards, tom lane
>
>
>

--
Thanks
Javin
http://javarevisited.blogspot.com/
Twitter : https://twitter.com/javinpaul
blog : http://java67.blogspot.com
blog : http://savingsfunda.blogspot.com

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Charles Sheridan 2019-05-18 03:31:33 Re: Problem in
Previous Message Jean-David Beyer 2019-05-17 16:09:44 Re: Problem in