[scilab-Users] Odd and Even numbers

Michael J. McCann mjmccann at iee.org
Wed Oct 28 11:53:50 CET 2009


All,
For generality, I think you should just make sure the number is an 
integer before you test its parity.
Mike.
=================


At 10:02 28/10/2009, you wrote:
>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
>
>
>______________________________________________________________________
>This email has been scanned by the MessageLabs Email Security System.
>For more information please visit http://www.messagelabs.com/email 
>______________________________________________________________________




More information about the users mailing list