Odd or even numbers
                
                    pavpav                
                
                     ✭                
            
                        
                
                                    
                                  in RobotStudio             
            
                    Hi
                I would like to check if a value is odd or even, does anyone have a good solution for this in RAPID?
I know its possible to divide a value by 2 and count the amount of decimals, but i cannot find a function that can count decimals.
Thank you
                0  
            Comments
- 
            Check out "MOD" -- IF nYourNumber MOD 2 = 0 THEN
0 - 
            As an extention of Soup his answer, check out this page to understand the mathematics behind the MOD instruction:It explains fairly well what MOD (A.K.A. Modulo) does.0
 
Categories
- All Categories
 - 5.6K RobotStudio
 - 401 UpFeed
 - 21 Tutorials
 - 15 RobotApps
 - 306 PowerPacs
 - 407 RobotStudio S4
 - 1.8K Developer Tools
 - 250 ScreenMaker
 - 2.9K Robot Controller
 - 363 IRC5
 - 81 OmniCore
 - 8 RCS (Realistic Controller Simulation)
 - 853 RAPID Programming
 - 31 AppStudio
 - 4 RobotStudio AR Viewer
 - 19 Wizard Easy Programming
 - 110 Collaborative Robots
 - 5 Job listings
 
