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.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 310 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings