|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||||
|
|||||
|
Re: Even and odd
Divide by 2, then compare the integer result to the floating point result. If they are equal, it's even.
|
|
#3
|
||||||
|
||||||
|
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.
|
|
#4
|
|||
|
|||
|
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Yet another NASA sponsored contest... And look, you can even win a Segway!! | Elgin Clock | Math and Science | 5 | 17-09-2003 12:26 |
| Even even more Segway stuff. | FotoPlasma | Dean Kamen's Inventions | 1 | 15-08-2003 22:15 |
| When the even and odd year/team rule will stop. | LizJJury | Rumor Mill | 19 | 17-04-2003 19:11 |
| OMG were and even number nice!!! | Erodge | General Forum | 6 | 11-10-2002 17:01 |
| question--- even or odd | Greg Perkins | Championship Event | 2 | 20-09-2002 19:47 |