Re: [HACKERS] IEEE 754

Поиск
Список
Период
Сортировка
От Sai Hertz And Control Systems
Тема Re: [HACKERS] IEEE 754
Дата
Msg-id 4002CCFE.7090402@sancharnet.in
обсуждение исходный текст
Ответ на Re: [HACKERS] IEEE 754  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: [HACKERS] IEEE 754  (Jan Wieck <JanWieck@Yahoo.com>)
Список pgsql-admin
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.


Regards,
Vishal Kashyap


В списке pgsql-admin по дате отправления:

Предыдущее
От: John Siracusa
Дата:
Сообщение: Re: pg_dump/pg_restore
Следующее
От: Sai Hertz And Control Systems
Дата:
Сообщение: Re: [HACKERS] IEEE 754