src/Tools/SML/factorial.sml
author wenzelm
Sat, 15 Apr 2023 14:14:30 +0200
changeset 77855 ff801186ff66
parent 56276 9e2d5e3debd3
permissions -rw-r--r--
minor performance tuning: more elementary operations;

fun factorial 0 = 1
  | factorial n = n * factorial (n - 1);

factorial 10;
factorial 100;
factorial 1000;