Re: factorial doc bug? - Mailing list pgsql-hackers

From Tatsuo Ishii
Subject Re: factorial doc bug?
Date
Msg-id 20010910141206C.t-ishii@sra.co.jp
Whole thread Raw
In response to Re: factorial doc bug?  (Gavin Sherry <swm@linuxworld.com.au>)
List 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


pgsql-hackers by date:

Previous
From: Gavin Sherry
Date:
Subject: Re: factorial doc bug?
Next
From: Karel Zak
Date:
Subject: Re: [PATCHES] CURRENT CVS: MULTIBYTE: CANT CONNECT....