The link at the bottom of this page will start a script that contains the type of divide-by-zero bug that has tormented computer users and crashed computer systems for decades. Here is the very short (three line) script that will execute:


  // average salary for employees
  
  // initialize total fields
  var TotalSalary = 0;
  var TotalEmployeeCount = 0;
  
  function main()
  {
     // add salaries for employees
     AddSalary( "Vera",   45000.00 );
     AddSalary( "Chuck",  27500.00 );
     AddSalary( "Dave",   27500.00 );
  
     // determine the average salary
     var AverageSalary = TotalSalary / TotalEmployeeCount ;
  
     cgi.out( "Average Salary = " + AverageSalary );
  }
  
  
  function AddSalary(Name,Salary)
  {
     TotalSalary += Salary;
  }

The problem in this script, as ScriptEase:WebServer Edition will report, is in line 15 where the TotalSalary is divided by TotalEmployeeCount, but TotalEmployeeCount has the value 0 because the writer of this script "forgot" to add a line to increment TotalEmployeeCount every time AddSalary() was called. When you execute the following script ScriptEase:WebServer Edition will report this error.

Execute DIVBY0.JSE