% age_real.m
% Watch the Theron child weight formula go over 1000 pounds.
% Take steps of 1/10000 (using real arithmetic!)
%
age = 1.0;
next_age = 1.0;

while ( true )

  weight = 2.20462 * exp ( 0.175571 * age + 2.197099 );
%
%  Print data at whole number ages.
%
  if ( age == next_age )     % <- Print weight at whole number ages, 1, 2, 3, ...
    fprintf ( 'Weight at age %d = %g\n', age, weight );
    next_age = next_age + 1;
  end
%
%  Exit if we have reached 1000 pounds.
%  
  if ( weight >= 1000.0 ) 
    fprintf ( 'Reached 1,000 pounds at age %g\n', age );
    break;
  end

  age = age + 0.0001;  % <- Take tiny steps in age, to see more detail.

end