[scilab-Users] Odd and Even numbers

jasper van baten jasper at amsterchem.com
Wed Oct 28 11:02:30 CET 2009


Dear Pedro,

Or use

  pmodulo(n,2)

which will return 1 for odd numbers, 0 for even numbers,

Best wishes,

Jasper van Baten

At 04:58 10/28/2009, Celso Co wrote:
>Dear Pedro
>
>Please try attached sample scilab code.
>I hope it helps.
>
>Regards,
>celso co
>
>
>On Tue, Oct 27, 2009 at 7:55 PM, Pedro Sousa 
><<http://pasousa.ml>pasousa.ml@<http://gmail.com>gmail.com> wrote:
>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
>
>
>
>
>--
>Eng'r Celso B. Co, PhD ECE
>Assistant Professor
>Dept. of Electronics, Computer, and Communication Engineering,
>Loyola Schools of Science and Engineering, Ateneo De Manila
>Content-Type: application/octet-stream; name="Odd Even.sci"
>Content-Disposition: attachment; filename="Odd Even.sci"
>X-Attachment-Id: f_g1bk21lf0




More information about the users mailing list