From:

Date:

December 11, 2017 03:42Subject:

%% with zero denominatorMessage ID:

CANan03aLX0DX_t09-wgiei=G0M1ieZascUmqhES7jm5OG8C0JA@mail.gmail.comI think of %% as being Perl 6's is-divisible-by operator, so I was a little surprised to discover this behavior: > 1 %% 0 Attempt to divide 1 by zero using infix:<%%> in block <unit> at <unknown file> line 1 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.Thread Next

**%% with zero denominator**by Sean McAfee- Re: %% with zero denominator by zoffix
- Re: %% with zero denominator by Sean McAfee
- Re: %% with zero denominator by Darren Duncan
- Re: %% with zero denominator by Elizabeth Mattijsen
- Re: %% with zero denominator by Sean McAfee
- Re: %% with zero denominator by Darren Duncan
- Re: %% with zero denominator by Sean McAfee
- Re: %% with zero denominator by Vittore Scolari
- Re: %% with zero denominator by Vittore Scolari
- Re: %% with zero denominator by Vittore Scolari
- Re: %% with zero denominator by Darren Duncan

nntp.perl.org: Perl Programming lists via nntp and http.

Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About