Re: Math Huh? - Mailing list pgsql-sql

From David Stanaway
Subject Re: Math Huh?
Date
Msg-id 1022802527.25795.7.camel@ciderbox
Whole thread Raw
In response to Math Huh?  (Josh Berkus <josh@agliodbs.com>)
List pgsql-sql
On Thu, 2002-05-30 at 18:29, Josh Berkus wrote:
> Folks,
>
> I'll let this session speak for itself:
>
> jwnet=> select version();
>                             version
> ---------------------------------------------------------------
>  PostgreSQL 7.2.1 on i686-pc-linux-gnu, compiled by GCC 2.95.3
> (1 row)
>
> jwnet=> select (255 * 255 * 255 * 255);
>  ?column?
> -----------
>  -66716671
> (1 row)
scratch=# select (255 * 255 * 255 * 255::int8); ?column?
------------4228250625
(1 row)

$ bc -l
obase=16
4228250625
FC05FC01
^

You have overflowed a signed integer as the most significant bit is set.

--
David Stanaway


pgsql-sql by date:

Previous
From: Larry Rosenman
Date:
Subject: Re: Math Huh?
Next
From: Josh Berkus
Date:
Subject: Re: Math Huh?