fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.
Fuzion
•
Idioms
•
Idiom # 265: Calculate parity of an integer
Idiom # 265: Calculate parity of an integer
See
programming-idioms.org
:
Code
i := 42 parity := i.ones_count % 2
What are effects?
Running example
ex165 is i := 42 parity := i.ones_count % 2 say parity
What are effects?
last changed: 2024-07-01
next: Idiom # 266: Repeating string