BUG #4749: trigonometric functions broken

Started by Stefano Salvadorabout 17 years ago3 messagesbugs
Jump to latest
#1Stefano Salvador
stefano.salvador@gmail.com

The following bug has been logged online:

Bug reference: 4749
Logged by: Stefano Salvador
Email address: stefano.salvador@gmail.com
PostgreSQL version: 8.3.7
Operating system: Linux
Description: trigonometric functions broken
Details:

try:

select sin(pi());

returns: 1.2246

or:

select cos(pi()/2);

returns: 6.123

but sin and cos are limited between -1 and 1 !!!

I suspect than tan() function is broken too.

#2Peter Eisentraut
peter_e@gmx.net
In reply to: Stefano Salvador (#1)
Re: BUG #4749: trigonometric functions broken

On Sunday 05 April 2009 13:44:37 Stefano Salvador wrote:

select sin(pi());

returns: 1.2246

or:

select cos(pi()/2);

returns: 6.123

but sin and cos are limited between -1 and 1 !!!

I get

=> select sin(pi());
sin
----------------------
1.22460635382238e-16
(1 row)

=> select cos(pi()/2);
cos
----------------------
6.12303176911189e-17
(1 row)

Apparently, your interface is truncating the output.

In reply to: Stefano Salvador (#1)
Re: BUG #4749: trigonometric functions broken

Stefano Salvador escreveu:

select sin(pi());

returns: 1.2246

euler=# select sin(pi());
sin
----------------------
1.22460635382238e-16
^^^^^

It works for me. You didn't pay attention at the precision.

--
Euler Taveira de Oliveira
http://www.timbira.com/