Re: Issues with factorial operator
От | Cui Shijun |
---|---|
Тема | Re: Issues with factorial operator |
Дата | |
Msg-id | 306760850706082311q190df4d1u58e090b67705cf0b@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Issues with factorial operator ("Dann Corbit" <DCorbit@connx.com>) |
Ответы |
Re: Issues with factorial operator
|
Список | pgsql-hackers |
Hi, 2007/6/9, Dann Corbit <DCorbit@connx.com>: > It makes sense with factorial function to do an error check on the > domain. Calculate beforehand, and figure out what the largest sensible > domain value is. well, in fact what we need is to calculate log10(n!) first to see if the result will get exceeded. > > For instance, in Maple, I get this: > > y:=92838278!; > Error, object too large > > > > The error message returns instantly. > > For reasonably large values, it might make sense to pre-compute > factorials and store them in an array. >It should also be possible to > store 1/2 of Pascal's triangle in memory and demand load that memory > segment the first time someone asks for factorials or combinations or > permutations. there may be too much memories to waste in that case... :-( Regards CUI Shijun
В списке pgsql-hackers по дате отправления: