recursiveMod HW9 - % the function should return 0. You may...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% 10/14/2009 % Function Name: recursiveMod % Inputs: 1.(Double) Dividend % 2.(Double) Divisor % Outputs: 1.(Double) Modulus % % Function Description: % This function take in two numbers and find the mod of those two % numbers recursively. It the number you are dividing with is negative,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % the function should return 0. You may assume the second input is % always an INTEGER. function out = recursiveMod(in1,in2) if in2 < 0 out = 0; elseif (in1-in2) < 0 out = in1; else out = recursiveMod((in1-in2),in2); end...
View Full Document

This note was uploaded on 10/22/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online