X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 3C798D1B471 for ; Fri, 26 Dec 2003 23:39:56 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 59182-02 for ; Fri, 26 Dec 2003 19:39:09 -0400 (AST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id B40D3D1B4D6 for ; Fri, 26 Dec 2003 19:39:05 -0400 (AST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.10/8.12.10) with ESMTP id hBQNbf19008204; Fri, 26 Dec 2003 18:37:41 -0500 (EST) To: aspire420@hotpop.com Cc: Wei Weng , Martin Marques , pgsql-sql@postgresql.org Subject: Re: Anti log in PostgreSQL In-reply-to: <3FECC357.6040206@sancharnet.in> References: <3FECB238.1050801@sancharnet.in> <200312261934.35070.martin@bugs.unl.edu.ar> <3FECBA50.2000500@sancharnet.in> <3FECBBEA.5080100@kencast.com> <3FECC357.6040206@sancharnet.in> Comments: In-reply-to Sai Hertz And Control Systems message dated "Sat, 27 Dec 2003 04:55:11 +0530" Date: Fri, 26 Dec 2003 18:37:40 -0500 Message-ID: <8203.1072481860@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/189 X-Sequence-Number: 16355 Sai Hertz And Control Systems writes: >> What is the mathematical operation that "antilog" is supposed to perform? > Its going to calculate rate of intrest for an fixed deposit , This is not a mathematical operation, it is a financial issue that has to conform to rules developed long ago by bankers. The closest thing that PG offers is 10^x, but regression=# select 10^(3.3234); ?column? ------------------ 2105.71698391175 (1 row) which is not real close to the 2144 that you say you want. The difference must be due to compounding rules, and perhaps also accumulated roundoff in the monetary amounts. I think you will need to write a little function (in plpgsql or your language of choice) that performs the sequence of compounding steps, if you want to get an answer that a banker will like. regards, tom lane