1 /****************************************************************************
3 Alumno: Leandro Lucarella
4 Fecha: dom mar 26 22:17:35 ART 2005
5 ****************************************************************************/
14 if X == 0.0 then N else {Num N X-1.0} end
16 % Denominador (factorial)
18 if X == 0.0 then 1.0 else X * {Fact X-1.0} end
25 {Num N K+1.0} / {Fact K}
28 % Combinatoria optimizada
30 if K > N / 2.0 then {Comb2 N N-K} else {Comb2 N K} end
32 % Imprimimos algo de ejemplo
33 {System.show {Comb 5.0 2.0}}
37 % vim: set et sw=4 sts=4 filetype=oz :