Incorrect rounding of double values at max precision

Поиск
Список
Период
Сортировка
От Gilleain Torrance
Тема Incorrect rounding of double values at max precision
Дата
Msg-id DB3D1D143DDA534BBB39DE713E92343701CBA89718@GBEDBP01.chp.co.uk
обсуждение исходный текст
Ответы Re: Incorrect rounding of double values at max precision  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

Hi,

 

When storing a double in Postgres, it looks like under specific circumstances it can get rounded incorrectly:

 

select round(cast(float8 '42258656681.38498' as numeric), 2), round(numeric '42258656681.38498', 2);

 

which returns either 42258656681.38 or 42258656681.39 depending on whether it is float8 or not.

 

Thanks,

 

Gilleain



Gilleain Torrance
Consultant

Alfa

e: Gilleain.Torrance@alfasystems.com | w: alfasystems.com
t: +44 (0)20 7920 2855 | Moor Place, 1 Fore Street Avenue, London, EC2Y 9DT,


The contents of this communication are not intended to be binding or constitute any form of offer or acceptance or give rise to any legal obligations on behalf of the sender or Alfa. The views or opinions expressed represent those of the author and not necessarily those of Alfa. This email and any attachments are strictly confidential and are intended solely for use by the individual or entity to whom it is addressed. If you are not the addressee (or responsible for delivery of the message to the addressee) you may not copy, forward, disclose or use any part of the message or its attachments. At present the integrity of email across the internet cannot be guaranteed and messages sent via this medium are potentially at risk. All liability is excluded to the extent permitted by law for any claims arising as a result of the use of this medium to transmit information by or to Alfa or its affiliates.

Alfa Financial Software Ltd
Reg. in England No: 0248 2325

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

Предыдущее
От: Bruno DUPUIS
Дата:
Сообщение: PGDG strech : postgresql-11-postgis-2.5 won't install beacause ofmissing dependency
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Re: Re: BUG #16068: Collate of 'Norwegian Bokmål' is problematic