Re: division by zero

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Eric B(dot)Ridge" <ebr(at)tcdi(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: division by zero
Date: 2003-03-07 19:34:35
Message-ID: 200303071934.h27JYZX15662@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers


I think this caused by floating point signals being reported by the OS,
while integer operations don't have signals. I suppose we could catch
the divide by zero easily. Folks?

---------------------------------------------------------------------------

Eric B.Ridge wrote:
> I admit, I suck at math, but I really thought postgres would ERROR on
> this:
>
> foo=# select 1/0;
> ?column?
> ----------
> 0
> (1 row)
>
> More surprising is that this does ERROR:
> foo=# select 1/0.0;
> ERROR: division by zero on numeric
>
> Is this a bug, or do I need to go back to high school algebra? "Both"
> is an acceptable answer. :)
>
> eric
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2003-03-07 19:43:43 Re: pg_ctl -m fast failing?
Previous Message Bruce Momjian 2003-03-07 19:22:21 Re: password method in pg_hba.conf fails

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2003-03-07 19:50:15 Re: division by zero
Previous Message Bruce Momjian 2003-03-07 19:28:59 Re: I cant find it or I'm just lazy ?