ToDADS errata: Chapter 6: Randomized Algorithms

published: Tue, 17-Jun-2003   |   updated: Sat, 20-Aug-2016

1. Page 208, Listing 6.12. The code for NormalRandomNumber forgets to apply the mean and standard deviation. There should be an extra line at the end of the routine to modify the resulting random number:

	...  		
	begin
	  if NRGNextIsSet then begin
	    ...
	  end
	  else begin
	    ...
	  end;
	  Result := (Result * aStdDev) + aMean;
	end;

Thanks to myself <g>.