Linking in sin() as a C function

From: mathprof(at)bigfoot(dot)com
To: pgsql-general(at)postgreSQL(dot)org
Subject: Linking in sin() as a C function
Date: 2000-02-01 03:48:19
Message-ID: 200002010350.VAA14455@bunyip.flash.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I tried the following, one at a time, to create sin() for PostgreSQL:

CREATE FUNCTION sin(float8) RETURNS float8 AS '/usr/lib/libm.so' LANGUAGE 'c';
CREATE FUNCTION sin(float4) RETURNS float4 AS '/usr/lib/libm.so' LANGUAGE 'c';
CREATE FUNCTION sin(float4) RETURNS float8 AS '/usr/lib/libm.so' LANGUAGE 'c';
CREATE FUNCTION sin(float8) RETURNS float4 AS '/usr/lib/libm.so' LANGUAGE 'c';

Each of these gave different and odd results (and a 'segmentation fault'
at one point), but none of them gave the right answer. What am I doing
wrong?

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tim Joyce 2000-02-01 07:44:05 select distinct
Previous Message Bruce Momjian 2000-02-01 02:11:04 Re: [GENERAL] SQL Book