[Scilab-users] Computing with very large numbers in Scilab

Calixte Denizet calixte.denizet at scilab-enterprises.com
Thu Jan 1 18:04:37 CET 2015


Hi Rafael,

You could use the function gammaln:
1-exp(gammaln(365 + 1)-(gammaln(365 - 23 + 1) + 23*log(365)))

Regards,

Calixte

On 01/01/2015 17:08, Rafael Guerra wrote:
> Dear Scilab'ers,
>
> Happy New Year.
> Does someone know to perform in Scilab computations involving very large
> numbers?
> For example, the how to compute the following probability formula:
> 1-365!/((365-23)! *365^23)
>
> 1-factorial(365)/(factorial(365-23)* 365^23)   produces Nan in Scilab
> The correct answer (using Wolfram Alpha) is: 0.507...
>
> Thanks and regards
> Rafael G.
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-- 
Calixte Denizet
Software Development Engineer
-----------------------------------------------------------
Scilab Enterprises
143bis rue Yves Le Coz - 78000 Versailles, France
http://www.scilab-enterprises.com




More information about the users mailing list