On 2017-12-11 12:22 PM, Sean McAfee wrote:
Well, not really. I don't think x %% 0 should return a Failure at all.
Is there a particular problem the current implementation fails to
solve? In boolean
context `x %% 0` *is* equivalent to False. The Failure carries
additional information
to those who want it. You can discard that information with `so x %%
0` if you aren't
already evaluating in Bool context. Seems returning a Failure is the
best of both worlds.
We try to follow IEEE 754-2008 standard whenever we can and I have
some memory of us
verifying last year stuff like modulo was reasonably conforming.
1 / 0 is an expression which can evaluate to no sensible value
It can produce a sensible value. In floating point context (that is in
Num view), that's a perfectly cromulent positive infinity, again per
IEEE 754 standard:
m: say (1 / 0).Num
rakudo-moar fed56be25: OUTPUT: «Inf»
Cheers,
ZZ