pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Piotr Stefaniak <postgres@piotr-stefaniak.me>
Cc: Noah Misch <noah@leadboat.com>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: Michael Paquier <michael.paquier@gmail.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Subject: Re: Proposal: Trigonometric functions in degrees
Date: Sun, 31 Jan 2016 17:41:38 +0100
Message-ID: <67665.1454258498@sss.pgh.pa.us> (raw)
In-Reply-To: <BLU437-SMTP154A9816D880D5B29BF28BF2DD0@phx.gbl>
References: <CAB7nPqS+wg+iWeL7pC1MS3ELmf4==XjJewH9_HPk+jx4NQ1E-g@mail.gmail.com>
	<CAB7nPqQ+KEtNXKUBNEzpOj4AESC8ipB3gUpgdbOb+b3KRgqzCw@mail.gmail.com>
	<CAEZATCW=tjGftAW44UcwpO419T83ZvdPC5vKH59WmDAA=7XjMw@mail.gmail.com>
	<CAEZATCUyVFyu2MFLk2uM28VQH2DmE=ryCuj8weBvyDOVe=8O2w@mail.gmail.com>
	<CAB7nPqQdichAyq3iNo_Ym9jgo6XkyuhivTV5tCG3E9Z_drCo6A@mail.gmail.com>
	<CAB7nPqRk+nNpJZ=AD8pG3305Bq9XwPrqEw4GUJhOk0XJ174W3w@mail.gmail.com>
	<31706.1448892680@sss.pgh.pa.us>
	<CAEZATCXO_ZVuj7xCco4GAFa_=KLJk3=aKnODLM47HB0SY=GKqw@mail.gmail.com>
	<21072.1453513223@sss.pgh.pa.us>
	<28880.1453568920@sss.pgh.pa.us>
	<20160123201625.GA3691823@tornado.leadboat.com>
	<BLU437-SMTP154A9816D880D5B29BF28BF2DD0@phx.gbl>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Piotr Stefaniak <postgres@piotr-stefaniak.me> writes:
> These changes from 65abaab547a5758b0d6d92df4af1663bb47d545f
> - result = sign * cosd_q1(arg1) / sind_q1(arg1);
> + result = sign * ((cosd_q1(arg1) / sind_q1(arg1)) / cot_45);

> and

> - result = sign * sind_q1(arg1) / cosd_q1(arg1);
> + result = sign * ((sind_q1(arg1) / cosd_q1(arg1)) / tan_45);

> both introduce division by zero, don't they?

Huh? cot_45 and tan_45 are fixed values that should be very close to 1.
Or were you complaining that the potential div by 0 existed beforehand?

It's possible that we should check for sind_q1(arg1) or cosd_q1(arg1)
being zero before we try the divide, and substitute get_float8_infinity()
instead.  But the regression tests exercise this case, and none of the
buildfarm members complained, so I'm a bit disinclined to add code for
that purpose.  If anyone does report regression test failure here, we can
revisit the issue then.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (57+ messages)

Message-ID: <67665.1454258498@sss.pgh.pa.us>
Permalink:  ../67665.1454258498@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/67665.1454258498@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, postgres@piotr-stefaniak.me, noah@leadboat.com, dean.a.rasheed@gmail.com, michael.paquier@gmail.com, peter_e@gmx.net
  Subject: Re: Proposal: Trigonometric functions in degrees
  In-Reply-To: <67665.1454258498@sss.pgh.pa.us>
  References: <CAB7nPqS+wg+iWeL7pC1MS3ELmf4==XjJewH9_HPk+jx4NQ1E-g@mail.gmail.com> <CAB7nPqQ+KEtNXKUBNEzpOj4AESC8ipB3gUpgdbOb+b3KRgqzCw@mail.gmail.com> <CAEZATCW=tjGftAW44UcwpO419T83ZvdPC5vKH59WmDAA=7XjMw@mail.gmail.com> <CAEZATCUyVFyu2MFLk2uM28VQH2DmE=ryCuj8weBvyDOVe=8O2w@mail.gmail.com> <CAB7nPqQdichAyq3iNo_Ym9jgo6XkyuhivTV5tCG3E9Z_drCo6A@mail.gmail.com> <CAB7nPqRk+nNpJZ=AD8pG3305Bq9XwPrqEw4GUJhOk0XJ174W3w@mail.gmail.com> <31706.1448892680@sss.pgh.pa.us> <CAEZATCXO_ZVuj7xCco4GAFa_=KLJk3=aKnODLM47HB0SY=GKqw@mail.gmail.com> <21072.1453513223@sss.pgh.pa.us> <28880.1453568920@sss.pgh.pa.us> <20160123201625.GA3691823@tornado.leadboat.com> <BLU437-SMTP154A9816D880D5B29BF28BF2DD0@phx.gbl> <67665.1454258498@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox