From help-request at octave dot org Sun Dec 25 20:41:26 2005 Subject: fractional remainder From: blah BLABBER To: help at octave dot org Date: Sun, 25 Dec 2005 18:37:46 -0800 (PST) --0-1499308234-1135564666=:4590 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Howdy folks, Question: I am a new Octave user and cannot figure out how to grab the remainder of a fraction. For example, if I take 3/4 = 0.75, I just want to grab the 75. Reason: I would like to check if the remainder is zero in order to determine if a number is odd or even. Any even number divided by 2 will have a remainder of 0, odd numbers will not. I am using this for loop control. Problem: In Octave, rem(3,4) gives 3. Obviously I do not understand this function. Can you please suggest the appropriate function to use. Thanks. --------------------------------- Yahoo! for Good - Make a difference this year. --0-1499308234-1135564666=:4590 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Howdy folks,

Question: I am a new Octave user and cannot figure out how to grab the remainder of a fraction. For example, if I take 3/4 = 0.75, I just want to grab the 75.

Reason: I would like to check if the remainder is zero in order to determine if a number is odd or even. Any even number divided by 2 will have a remainder of 0, odd numbers will not. I am using this for loop control.

Problem: In Octave,  rem(3,4) gives 3. Obviously I do not understand this function. Can you please suggest the appropriate function to use.

Thanks.


Yahoo! for Good - Make a difference this year. --0-1499308234-1135564666=:4590-- ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------