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


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 51 times
Size: 110,46 KiB
Type: text/xml
Downloaded 695 times
Size: 7,43 KiB
Type: text/xml
Downloaded 711 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 51 times
Size: 110,46 KiB
Type: text/xml
Downloaded 695 times
Size: 7,43 KiB
Type: text/xml
Downloaded 711 times
Size: 354,00 B

Spitze, danke Nemo!


https://campus.allplan.com/ uses cookies  -  More information

Accept