On 2013-01-26, Gavan Schneider wrote:
> On Saturday, January 26, 2013 at 08:13, Ian Pilcher wrote:
>
>>I need to cast a double precision into an integer, and I want to check
>>that the value will actually fit (modulo rounding).
>>
>>Coming from a C/Java background, this seems like something that s
On 2013-01-26, Ian Pilcher wrote:
> I need to cast a double precision into an integer, and I want to check
> that the value will actually fit (modulo rounding).
>
> Coming from a C/Java background, this seems like something that should
> be utterly trivial. In my searching, however, I can't seem
On 01/26/2013 03:09 PM, Ian Pilcher wrote:
On 01/26/2013 05:06 PM, Alexander Gataric wrote:
Just cast to integer. Decimal portion will be lost.
That part I've got. :-)
It's checking that the double precision value will actual fit within the
range of the integer type (-2147483648 to +21474836
On Saturday, January 26, 2013 at 08:13, Ian Pilcher wrote:
I need to cast a double precision into an integer, and I want to check
that the value will actually fit (modulo rounding).
Coming from a C/Java background, this seems like something that should
be utterly trivial. In my searching, howe
On 01/26/2013 05:06 PM, Alexander Gataric wrote:
> Just cast to integer. Decimal portion will be lost.
That part I've got. :-)
It's checking that the double precision value will actual fit within the
range of the integer type (-2147483648 to +2147483647). I could
certainly hard-code these value
Just cast to integer. Decimal portion will be lost.
Sent from my smartphone
- Reply message -
From: "Ian Pilcher"
To:
Subject: [GENERAL] Cast double precision to integer & check for overflow
Date: Sat, Jan 26, 2013 3:13 pm
I need to cast a double precision into an integ
I need to cast a double precision into an integer, and I want to check
that the value will actually fit (modulo rounding).
Coming from a C/Java background, this seems like something that should
be utterly trivial. In my searching, however, I can't seem to find any
SQL equivalent of INT_MAX, Integ