Re: precision and scale functions for numeric

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "'Robert Haas'" <robertmhaas(at)gmail(dot)com>, "'Peter Eisentraut'" <peter_e(at)gmx(dot)net>, "David Johnston" <polobo(at)yahoo(dot)com>
Cc: "'pgsql-hackers'" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: precision and scale functions for numeric
Date: 2012-04-30 19:40:41
Message-ID: 4F9EA46902000025000475D9@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"David Johnston" <polobo(at)yahoo(dot)com> wrote:

>> I think you could test for integer-ness by testing whether val % 0 =
0.

> Modulus is a division function anything "% 0" results in a
division-by-zero

It seems pretty clear that he meant "% 1".

test=# select '1.01'::numeric % 1;
?column?
----------
0.01
(1 row)

-Kevin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2012-04-30 20:13:38 Re: Future In-Core Replication
Previous Message Robert Haas 2012-04-30 19:39:43 Re: precision and scale functions for numeric