Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Even and odd (http://www.chiefdelphi.com/forums/showthread.php?t=87160)

saworms 16-10-2010 12:22

Even and odd
 
It is my first day in labview and I need to determine if a number is even or odd.
Can someone please tell me how to do it.

Spencer

DonRotolo 16-10-2010 12:49

Re: Even and odd
 
Divide by 2, then compare the integer result to the floating point result. If they are equal, it's even.

Joe Ross 16-10-2010 12:55

Re: Even and odd
 
Are you having trouble figuring out how to determine if a number is even, or how to implement the algorithm in LabVIEW. Perhaps you could ask more specific problems.

Greg McKaskle 16-10-2010 15:09

Re: Even and odd
 
To keep it integer, use the remainder and quotient block. It is similar to the mod() operation in some other languages. If N div 2 has a remainder of 0, it was even.

Greg McKaskle


All times are GMT -5. The time now is 10:05.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi