icon

[Question] Prüfung gerade/ungerade Zahl [Solved]

Tags:
  • Allplan 2021-0-7

Hallo,

ich würde gerne im VS eine Zahl dahingehen prüfen lassen ob es sich bei dieser um eine gerade, oder eine ungerade Zahl handelt.
Ist dies mit den derzeit verfügbaren Nodes irgendwie möglich? (Idealerweise mit einem true/false Ausgabewert als Ergebnis)

Grüße,
Mario

Show solution Hide solution

Test ob Ganzzahl x geradzahlig ist:

1. a = int(x/2)
2. b = 2*a
3. x == b ? True : False

Attachments (3)

Type: image/png
Downloaded 71 times
Size: 110,46 KiB
Type: text/xml
Downloaded 2155 times
Size: 7,43 KiB
Type: text/xml
Downloaded 2119 times
Size: 354,00 B

Test ob Ganzzahl x geradzahlig ist:

1. a = int(x/2)
2. b = 2*a
3. x == b ? True : False

Attachments (3)

Type: image/png
Downloaded 71 times
Size: 110,46 KiB
Type: text/xml
Downloaded 2155 times
Size: 7,43 KiB
Type: text/xml
Downloaded 2119 times
Size: 354,00 B

Spitze, danke Nemo!