Re: [HACKERS] IEEE 754

From: Jan Wieck <JanWieck(at)Yahoo(dot)com>
To: aspire420(at)hotpop(dot)com
Cc: Michael Glaesemann <grzm(at)myrealbox(dot)com>, Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, pgsql-admin(at)postgresql(dot)org, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] IEEE 754
Date: 2004-01-12 16:45:17
Message-ID: 4002CF1D.3030406@Yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-hackers

Sai Hertz And Control Systems wrote:

> Dear Jan Wieck ,
>
>>>> Floating point math itself is not precise, but rather an approximation,
>>>> usually of 8 or 14 digits. You can't approximate money. This isn't a
>>>> PostgreSQL issue but rather a general programming issue.
>>>
>>>
>>> Thanks, Bruce. I assume the arbitrary precision arithmetic Jan
>>> mentioned which is used for the NUMERIC type takes care of this.
>>
>>
>> That was the whole intention. Although Bruce is wrong, since most of
>> the time money is approximated. It is only in "bookkeeping" where this
>> is not allowed.
>
> Yes I agree with you Jan , most of the time we round the amount and
> this is done by truncating greater than 3 decimal digits and rounding
> the 3 digit to 2 in other words :
> select trunc(1000.236897,3);
> then
> selecr round(1000.236,2);
> This takes care of the rounding factor in money as per Indian standards
> ok, how will you verify it simple just use log and you will get the
> correct output.

What most people do not understand is the fact that real bookkeeping
only uses the 4 basic mathematical operators, and multiplication and
division even only when dealing with interest-, customs- or tax-rates.

Everything that uses any higher functions like power, logarithms and the
like is controlling and financial anlysis, maybe using accounting data,
but never feeding anything back into the bookkeeping.

People are often under the impression that effective APR's and all that
stuff fall into the same category as your bank or credit card account
balance. But that is not true.

Jan

--
#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Jan Wieck 2004-01-12 17:12:40 Re: [HACKERS] IEEE 754
Previous Message Sai Hertz And Control Systems 2004-01-12 16:36:14 Re: [HACKERS] IEEE 754

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Wieck 2004-01-12 17:12:40 Re: [HACKERS] IEEE 754
Previous Message Sai Hertz And Control Systems 2004-01-12 16:36:14 Re: [HACKERS] IEEE 754