Broken acos in PL/PGSQL?

Поиск
Список
Период
Сортировка
Искать

Broken acos in PL/PGSQL?

От:
pgsql-gen Newsgroup (@Basebeans.com) <pgsql-gen@basebeans.com>
Дата:
Subject: [GENERAL] Broken acos in PL/PGSQL?
From: Milo Hyson 
 ===
I just ran into a show stopper exception on one of my systems. It seems the 
acos() function in PL/PGSQL throws an exception if it's called with a 1. All 
other acos() implementations I've ever used return a zero. I did some poking 
around and every acos() reference I could find for other software returns a 
zero. Is Postgres' implementation intentional or an oversight? In the context 
of my application, zero is the correct value to return in this case.

-- 
Milo Hyson
CyberLife Labs, LLC

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql.org so that your
message can get through to the mailing list cleanly

Re: Broken acos in PL/PGSQL?

От:
Darren Ferguson <darren@crystalballinc.com>
Дата:
Seems to work fine here

oss=> select acos(1);
 acos 
------
    0
(1 row)

oss=> create function stest(integer) returns integer as '
oss'> declare
oss'>  _num alias for $1;
oss'> begin
oss'>  return acos(_num);
oss'> end;' language 'plpgsql';
CREATE
oss=> select stest(1);
 stest 
-------
     0
(1 row)

Version information

oss=> select version();
                           version                           
-------------------------------------------------------------
 PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.96
(1 row)

What version are you running???



On Mon, 5 Aug 2002, pgsql-gen Newsgroup wrote:

> Subject: [GENERAL] Broken acos in PL/PGSQL?
> From: Milo Hyson 
>  ===
> I just ran into a show stopper exception on one of my systems. It seems the 
> acos() function in PL/PGSQL throws an exception if it's called with a 1. All 
> other acos() implementations I've ever used return a zero. I did some poking 
> around and every acos() reference I could find for other software returns a 
> zero. Is Postgres' implementation intentional or an oversight? In the context 
> of my application, zero is the correct value to return in this case.
> 
> 

-- 
Darren Ferguson

FAQ