Re: Re: [GENERAL] Trouble with float4 afterupgrading from 6.5.3 to 7.0.2

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: Re: [GENERAL] Trouble with float4 afterupgrading from 6.5.3 to 7.0.2
Дата
Msg-id 3.0.1.32.20000808055000.014353d0@mail.pacifier.com
обсуждение исходный текст
Ответ на Re: Re: [GENERAL] Trouble with float4 afterupgrading from 6.5.3 to 7.0.2  (Philip Warner <pjw@rhyme.com.au>)
Ответы Re: Re: [GENERAL] Trouble with float4 afterupgrading from 6.5.3 to 7.0.2  (Philip Warner <pjw@rhyme.com.au>)
Список pgsql-hackers
At 01:37 PM 8/8/00 +1000, Philip Warner wrote:

>- do an intermediate text or numeric conversion. This will produce more
>expected results

By who?  I'm serious.  I sure wouldn't.  I can't think of any language
implementation that does this.  The standard approach has the advantage
of maintaining a defined significance.  The approach you suggest doesn't,
you're actually losing significance.  It gives the illusion of increasing
for the particular example you've chosen, but it is nothing but illusion.

>Would it be worth having some kind of DB setting for how it handles
>float4/8 conversion?

Use type numeric when you need precise decimal results.  Your suggested
kludge won't give you what you want.

>Do you know how fast 'numeric' is?

Not as fast as float by any means, but there's a reason why they exist 
in all languages which include the financial sphere in their presumed
application space.

The simplest thing is to realize that using float4 leaves you with
just over 7 significant digits, and to only print out 7 digits.
Then you'll get the answer you expect (10.100000).



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


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

Предыдущее
От: Karel Zak
Дата:
Сообщение: Re: Constraint stuff
Следующее
От: Tom Lane
Дата:
Сообщение: Re: AW: UNIONS