Hello list:
I apologize if this is already a very well known issue, but i've found that
the "fact" (factorial) function does not seem to work properly in the
"expr" external when called with an argument greater than 12.
I attached a patch in which i've made my own abstraction (which I cannot
tell it is done  in the most efficient way, but matches the result of any
calculator) to show the discrepancy. Am I doing something wrong?

Oscar Pablo Di Liscia
#N canvas 584 172 727 416 24;
#X obj 207 266 print expr;
#X obj 254 188 print my_fact;
#X obj 37 9 hradio 20 1 0 20 empty empty empty 0 -8 0 10 -262144 -1
-1 0;
#X floatatom 207 74 5 0 0 0 - - -, f 5;
#X obj 37 41 + 1;
#N canvas 293 108 762 658 my_fact 0;
#X obj 269 9 inlet;
#X obj 119 626 outlet;
#X obj 293 377 counter;
#X obj 236 354 until;
#X obj 293 418 + 1;
#X obj 146 463 f;
#X obj 293 464 * 1;
#X msg 323 246 1, f 1;
#X obj 204 559 select;
#X obj 119 593 f;
#X obj 236 163 t f f b b;
#X obj 269 73 moses 1;
#X obj 350 163 print out_of_range_argument;
#X connect 0 0 11 0;
#X connect 2 0 4 0;
#X connect 3 0 2 0;
#X connect 4 0 6 0;
#X connect 4 0 8 0;
#X connect 5 0 6 1;
#X connect 5 0 9 1;
#X connect 6 0 5 0;
#X connect 7 0 6 1;
#X connect 8 0 9 0;
#X connect 9 0 1 0;
#X connect 10 0 3 0;
#X connect 10 1 8 1;
#X connect 10 2 2 2;
#X connect 10 3 7 0;
#X connect 11 0 12 0;
#X connect 11 1 10 0;
#X restore 254 149 pd my_fact;
#X obj 207 110 t f f f;
#X obj 452 143 print factorial of;
#X text 39 -41 Factorial in expr and in an abstraction;
#X obj 207 227 expr fact($f1);
#X connect 2 0 4 0;
#X connect 3 0 6 0;
#X connect 4 0 3 0;
#X connect 5 0 1 0;
#X connect 6 0 9 0;
#X connect 6 1 5 0;
#X connect 6 2 7 0;
#X connect 9 0 0 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
https://lists.puredata.info/listinfo/pd-list

Reply via email to