function test_machine_epsilon_matlab( method )

if method == 0  % INCORRECT METHOD:  TESTING WHEN 10^(-n) equals 0

    small = 1.0;
    i = 0;
    while i < 1000, 
        small = small / 10.0;
        i = i + 1;
        fprintf('step %d:   %38.33f   %f\n', ...
            i, small, log(abs(small))/log(10.0));
        if small == 0.0 
            fprintf('\n Number of steps:    %d\n\n\n', i); 
            return;
        end
    end

elseif method == 1  % CORRECT METHOD:  TESTING WHEN 1+10^(-n) equals 1

    small = 1.0;
    i = 0;
    while i < 1000, 
        small = small / 10.0;
        one_plus_small = 1.0 + small;
        i = i + 1;
        fprintf('step %d:   %38.33f   %f\n', ...
            i, one_plus_small, log(abs(one_plus_small-1.0))/log(10.0));
        if one_plus_small == 1.0 
            fprintf('\n Number of steps:    %d\n\n\n', i); 
            return;
        end
    end
    
else
    fprintf('\n   The variable METHOD must equal ');
    fprintf('1 (for incorrect) or 0 (for correct)!\n\n');

end
