X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id AEBF45E3632 for ; Tue, 31 Aug 2004 10:13:42 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 02124-07 for ; Tue, 31 Aug 2004 13:13:31 +0000 (GMT) Received: from trade-india.com (unknown [203.101.29.7]) by svr1.postgresql.org (Postfix) with SMTP id 4871C5E46C2 for ; Tue, 31 Aug 2004 10:13:32 -0300 (ADT) Received: (qmail 25887 invoked from network); 31 Aug 2004 13:07:26 -0000 Received: from system100.trade-india-local.com (HELO ?192.168.0.100?) (192.168.0.100) by system66.trade-india-local.com with SMTP; 31 Aug 2004 13:07:26 -0000 Message-ID: <41347A0F.70300@trade-india.com> Date: Tue, 31 Aug 2004 18:45:59 +0530 From: Rajesh Kumar Mallah User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Glaesemann Cc: pgsql-sql@postgresql.org Subject: Re: Arbitrary precision arithmatic with pgsql References: <41346727.8080901@trade-india.com> <1089006C-FB4B-11D8-A2A0-000A95C88220@myrealbox.com> In-Reply-To: <1089006C-FB4B-11D8-A2A0-000A95C88220@myrealbox.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200408/341 X-Sequence-Number: 18838 Michael Glaesemann wrote: > > On Aug 31, 2004, at 9:17 PM, Michael Glaesemann wrote: > >> What you need is a power operation for numeric, which I think you'd >> have to write yourself, > > > Looking a little closer, there is a pow() function that takes two > numeric arguments and returns numeric. > > > > test=# select pow(2::numeric,100::numeric); > pow > -------------------------------------------------- > 1267650600228229401496703205376.0000000000000000 > (1 row) > > Sorry for the misinformation. > > If you'd like, I think you can overload the ^ operator to work on > numeric as well if you don't want to use pow(). See the following page > for more information. > > Yep thats cool. Thanks for the research! but i still wonder if a warning or info message were appropriate at some stage so that people do not confuse it with sielent loss of accuracy . I know this example is *not* a case of where postgresql is truncating data at the insert level (like mysql does) but at the calculation level. regds mallah. regds mallah. > > Michael Glaesemann > grzm myrealbox com > > > !DSPAM:4134745e87571738116768! > > -- regds Mallah. Rajesh Kumar Mallah +---------------------------------------------------+ | Tradeindia.com (3,11,246) Registered Users | | Indias' Leading B2B eMarketPlace | | http://www.tradeindia.com/ | +---------------------------------------------------+