Re: factorial doc bug?

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: swm(at)linuxworld(dot)com(dot)au
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: factorial doc bug?
Date: 2001-09-10 05:12:06
Message-ID: 20010910141206C.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On Mon, 10 Sep 2001, Tatsuo Ishii wrote:
>
> > In typeconv.sgml we have an example:
> >
> > tgl=> select (4.3 !);
> > ?column?
> > ----------
> > 24
> > (1 row)
>
> Mathematically speaking, one cannot find the factorial of such a
> number. Users could easily cast/round a float to an integer - making it
> suitable for such an operation.
>
> I'd say it was a documentation issue.

My point is the docs claims that PostgreSQL automaticaly converts 4.3
to 4 in this case.

>This example illustrates an interesting result. Traditionally, the
>factorial operator is defined for integers only. The <productname>Postgres</productname>
>operator catalog has only one entry for factorial, taking an integer operand.
>If given a non-integer numeric argument, <productname>Postgres</productname>
>will try to convert that argument to an integer for evaluation of the
>factorial.
--
Tatsuo Ishii

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Karel Zak 2001-09-10 06:27:52 Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....
Previous Message Gavin Sherry 2001-09-10 05:03:55 Re: factorial doc bug?