% age_integer.m
% Watch the Theron child weight formula go over 1000 pounds.
% Take steps of 1/10000 (integer arithmetic!)
%
i = 10000; % Start at age = 1.

while ( true );
  age = i / 10000;
  weight = 2.20462 * exp ( 0.175571 * age + 2.197099 );
%
%  Print data at whole number ages.
%
  if ( mod ( i, 10000 ) == 0 )
    fprintf ( 'X = %g, Weight = %g\n', age, weight );
  end
%
%  Break when we reach 1000 pounds.
%
  if ( weight >= 1000.0 )
    fprintf ( 'Exceeded 1000 pounds at age %g\n', age );
    break;
  end

  i = i + 1;  % Ready for next step.

end