Re: Problem with factorial operator

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jean-Luc Lachance <jllachan(at)nsd(dot)ca>
Cc: "PostgreSQL General Help (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Problem with factorial operator
Date: 2002-04-18 03:36:54
Message-ID: 200204180336.g3I3asb02755@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Jean-Luc Lachance wrote:
> Hi all,
>
> The PG Documentation states:
>
>
> tgl=> select cast(text '44' as int8) ! as "factorial";
> factorial
> ---------------------
> 2673996885588443136
> (1 row)
>
>
> If you try it, you will get the same result, but it is the wrong answer.
> Factorial work up to 20. After that one gets negative results.

I changed the docs to do a 20!.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 2.8 KB

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2002-04-18 03:50:15 Re: Date precision problem
Previous Message Bruce Momjian 2002-04-18 03:06:45 Re: Re : Solaris Performance - Profiling (Solved)