next up previous contents
Next: Producing HTML Code Up: Measuring Performance Previous: option numeric

A Small Example

To show the difference in running time between a routine which includes the option numeric versus one that does not include this option, we iterate over a non-trivial mathematical expression and check the elapsed CPU time.

SmallExample := proc ( )
  local total;
  option numeric;

  total := 0;
  for i from 1 to 10000 do
    total := total  * (mod (i, 50)) - log(i) + sqrt(i);
  od;
  return(total);
end:



Gaston Gonnet
1998-09-15