- Posts: 455
Checking whether a number is even or odd
- FlowHeater-Team
-
Topic Author
- Offline
- Admin
-
Less
More
- #3844
by FlowHeater-Team
Best wishes
Robert Stark
Checking whether a number is even or odd was created by FlowHeater-Team
Translated post from the German Support Forum. You can find the original post here:
Auswertung, ob Zahl gerade oder ungerade
Hi,
Is there a Heater (or a simple solution) that can be used to determine whether a number is even or odd? Currently, I extract the last digit of a number, replace it with T or F using Replace, and then evaluate it with IF. It’s not particularly elegant, but it’s necessary to correctly process duplicate individual rows
Best regards, Kai
Hi,
Is there a Heater (or a simple solution) that can be used to determine whether a number is even or odd? Currently, I extract the last digit of a number, replace it with T or F using Replace, and then evaluate it with IF. It’s not particularly elegant, but it’s necessary to correctly process duplicate individual rows
Best regards, Kai
Best wishes
Robert Stark
Last edit: by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
-
Topic Author
- Offline
- Admin
-
Less
More
- Posts: 455
#3845
by FlowHeater-Team
Best wishes
Robert Stark
Replied by FlowHeater-Team on topic Checking whether a number is even or odd
Hi Kai,
You can solve this very elegantly using the Modulo Heater . It returns the remainder of a division. If you enter “2” as the Modulo value, you'll get a remainder of 0 if the number is even; otherwise, you won't.
Attached is a short example showing how you can use the IF-THEN-ELSE Heater to set up a check for this.
You can solve this very elegantly using the Modulo Heater . It returns the remainder of a division. If you enter “2” as the Modulo value, you'll get a remainder of 0 if the number is even; otherwise, you won't.
Attached is a short example showing how you can use the IF-THEN-ELSE Heater to set up a check for this.
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Best wishes
Robert Stark
Please Log in or Create an account to join the conversation.
Time to create page: 0.114 seconds
