[scilab-Users] Odd and Even numbers

Francis Drossaert Francis.Drossaert at pgs.com
Tue Oct 27 13:39:25 CET 2009


You can use the modulo command. This is how matlab does, I believe. 

For example:

if modulo(x,2) == 0
	disp('x is even');
else
	dsip('x is odd');
end

-----Original Message-----
From: Pedro Sousa [mailto:pasousa.ml at gmail.com] 
Sent: 27 October 2009 11:55
To: users at lists.scilab.org
Subject: [scilab-Users] Odd and Even numbers

Hi to all,

I've been searching how to check if a number is odd or even. I could not
find a function to do it.

I can't also use the scilab operations like I use in C, when working
with integer data. My question is how can I check if a number if even or
odd?

best regards
Pedro


This e-mail, including any attachments and response string, may contain proprietary information which is confidential and may be legally privileged. It is for the intended recipient only. If you are not the intended recipient or transmission error has misdirected this e-mail, please notify the author by return e-mail and delete this message and any attachment immediately. If you are not the intended recipient you must not use, disclose, distribute, forward, copy, print or rely on this e-mail in any way except as permitted by the author.



More information about the users mailing list