On Mon, Dec 11, 2017 at 1:52 AM, Elizabeth Mattijsen <l...@dijkmat.nl> wrote:
> > On 11 Dec 2017, at 04:42, Sean McAfee <eef...@gmail.com> wrote: > > The docs say a %% b is True if a % b is 0, so the error is as-designed, > at least. But mightn't it make more sense for %% to just return False when > given a second zero operand? After all, the answer to "is n divisible by > zero" is false for any n--there's no need to try to go through with the > division to ascertain this. > > Note that x %% 0 returns a Failure ( https://docs.perl6.org/type/Failure > ), which will be evaluated to False in a Boolean context. So it is already > doing what you want. Well, not really. I don't think x %% 0 should return a Failure at all. 1 / 0 is an expression which can evaluate to no sensible value, so it makes sense to fail there. By the question "Is one divisible by zero?" has the simple answer "No."