Received: from uni-bremen.de (umehlig@moritz98.zfn.uni-bremen.de [134.102.6.138]) by hub.org (8.9.1/8.9.1) with ESMTP id CAA24571 for ; Fri, 20 Nov 1998 02:01:26 -0500 (EST) (envelope-from umehlig@uni-bremen.de) Received: (from umehlig@localhost) by uni-bremen.de (8.9.1/8.9.1) id IAA01780; Fri, 20 Nov 1998 08:00:01 +0100 Date: Fri, 20 Nov 1998 08:00:01 +0100 From: Ulf Mehlig Message-Id: <199811200700.IAA01780@uni-bremen.de> To: molivier@yahoo.com CC: pgsql-sql@postgreSQL.org In-reply-to: <19981120055303.6281.rocketmail@send105.yahoomail.com> (molivier@yahoo.com) Subject: Re: [SQL] abs value, power, sqrt References: <19981120055303.6281.rocketmail@send105.yahoomail.com> Michael Olivier wrote: > I need a way to get abs value of a floating point number and > (possibly separate function for) abs value of an integer in a select > statement. You had to look up the manuals at numerical *operators* -- no need to define YAF ;-) => select @-17.0; 17 > Also how do I do squares and square roots? I saw some \|/ type > notation for square root in an SQL book, but I didn't get postgres > to take that. try e.g. => select 2*2, 2^2; 4 4 and: => select |/2; 1.4142135623731 without the backslash (originally quoting in a shell?) it seems to work ... Hope it helps Ulf -- ====================================================================== %%%%% Ulf Mehlig %%%%!%%% Projekt "MADAM" %%%% %!% %%%% ---------------------------------------------------- ---| %%% MADAM: MAngrove | Center for Tropical Marine ||--%!% Dynamics | Biology || And | Fahrenheitstrasse 1 _ /||\_/\_ Management | / / \ \ ~~~~~~~~~~~~~~~~~ | 28359 Bremen/Germany ~~~~~~~~~~~~~~~~~~~~