3 ms·
> x <= y is the same as !(x > y) i.e. two tests, or perhaps i should say logical operations. i'm not saying don't use '<=', but do check that it is doing what
by zabzonk 3y ago
> x <= y is the same as !(x > y)
i.e. two tests, or perhaps i should say logical operations. i'm not saying don't use '<=', but do check that it is doing what you think it should.
- derefr 3y agoLet me put it another way: the following are the same code: if: x <= y, do: foo(), else: nothing() if: y < x, do: nothing(), else: foo()
- AugurCognito 3y agoShouldn't the last statement be: if: y > x, do: nothing(), else: foo()
- rurban 3y agoNope, order of evaluation might matter with impure code.
- rowanG077 3y agoHow exactly? Well there is an extreme case where x and y are volatile but even then the order is implementation defined so I can't see a world where it matters.