pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Stanaway <david@stanaway.net>
To: pgsql-sql@postgresql.org
Subject: Re: Math Huh?
Date: 30 May 2002 18:48:47 -0500
Message-ID: <1022802527.25795.7.camel@ciderbox> (raw)
In-Reply-To: <200205301629.26161.josh@agliodbs.com>
References: <200205301629.26161.josh@agliodbs.com>

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

Attachments:

  signature.asc (application/pgp-signature, 480B) download

view thread (7+ messages)  latest in thread

Message-ID: <1022802527.25795.7.camel@ciderbox>
Permalink:  ../1022802527.25795.7.camel@ciderbox/
Also on:    postgresql.org/message-id/1022802527.25795.7.camel@ciderbox

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: david@stanaway.net
  Subject: Re: Math Huh?
  In-Reply-To: <1022802527.25795.7.camel@ciderbox>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox