view test/test_recursion.m @ 5916:22e4b22f07dc

Added tag ss-2-9-7 for changeset b2e1be30c8e9
author jwe@segfault.lan
date Fri, 01 Feb 2008 22:20:06 -0500
parents 1ad66ea35fe5
children 93c65f2a5668
line wrap: on
line source

%% Automatically generated from DejaGNU files

%% test/octave.test/recursion/recursion-1.m
%!function y = f (x)
%!  if (x == 1)
%!    y = x;
%!    return;
%!  else
%!    y = x * f (x-1);
%!  endif
%!test
%! assert(f (5),120);

%% test/octave.test/recursion/recursion-2.m
%!function y = f (x)
%!  if (x == 1)
%!    y = x;
%!    return;
%!  else
%!    y = f (x-1) * x;
%!  endif
%!test
%! assert(f (5),120);