Re: precision and scale functions for numeric - Mailing list pgsql-hackers

From David Johnston
Subject Re: precision and scale functions for numeric
Date
Msg-id 014701cd2708$2aa01bd0$7fe05370$@yahoo.com
Whole thread Raw
In response to Re: precision and scale functions for numeric  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: precision and scale functions for numeric  (Robert Haas <robertmhaas@gmail.com>)
Re: precision and scale functions for numeric  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
> -----Original Message-----
> From: pgsql-hackers-owner@postgresql.org [mailto:pgsql-hackers-
> owner@postgresql.org] On Behalf Of Robert Haas
> Sent: Monday, April 30, 2012 2:20 PM
> To: Peter Eisentraut
> Cc: pgsql-hackers
> Subject: Re: [HACKERS] precision and scale functions for numeric
> 
> 
> I think you could test for integer-ness by testing whether val % 0 = 0.
> 

Either I am missing something here or you are.  Since Modulus is a division
function anything "% 0" results in a division-by-zero ERROR - division has
to occur before a remainder can be obtained.

Maybe "val % 2 NOT IN (0,1)" ...

David J.






pgsql-hackers by date:

Previous
From: "Albe Laurenz"
Date:
Subject: Re: Analyzing foreign tables & memory problems
Next
From: Robert Haas
Date:
Subject: Re: Future In-Core Replication