|
|
|
|
|
by SkyBelow
902 days ago
|
|
Given the lack of integers and my hesitancy to trust modulo for non-integer variables, I don't know if I would trust it. You would need to add some safety checks, but either you create an is_even/is_odd function that has safety checks, or you have to rely on developers adding in the checks anytime the number might have been in close proximity to a floating point number. Something as simple as this can end up being neither even or odd. (0.1 + 0.2) * 10
|
|