- Posts: 453
Checking whether a number is even or odd
- FlowHeater-Team
-
Topic Author
- Offline
- Admin
-
Less
More
1 hour 4 minutes ago - 1 hour 4 minutes ago #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: 1 hour 4 minutes ago by FlowHeater-Team.
Please Log in or Create an account to join the conversation.
- FlowHeater-Team
-
Topic Author
- Offline
- Admin
-
Less
More
- Posts: 453
59 minutes ago #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.
Best wishes
Robert Stark
Please Log in or Create an account to join the conversation.
Time to create page: 0.138 seconds