money bug

From: Sferacarta Software <sferac(at)bo(dot)nettuno(dot)it>
To: pgsql-hackers(at)postgresql(dot)org
Subject: money bug
Date: 1999-01-04 14:14:30
Message-ID: 14635.990104@bo.nettuno.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

I have this funny result when I tried to multiply a money by a float:

select '($21,474,836.48)'::money / '1.0'::float8;
?column?
----------------
($./,,),,(-*.,()
(1 row)

select '$21,474,836.47'::money * '2.0'::float8;
?column?
----------------
($./,,),,(-*.,()
(1 row)

--If I use integer instead of float it gives me an expected overflow
--result:

select '$21,474,836.47'::money * '2'::int4;
?column?
--------
($0.02)
(1 row)

I'm using v6.4 on Linux.

-Jose'-

Browse pgsql-hackers by date

  From Date Subject
Next Message The Hermit Hacker 1999-01-04 14:22:48 Re: [HACKERS] a test
Previous Message Sferacarta Software 1999-01-04 14:12:58 int4 range