On 2017-12-11 5:21 PM, Sean McAfee wrote:
Well, /any/ function or operator that returns a boolean /could/ return a Failure
instead of (or in addition to) False to provide additional information to those
who want it, but if the condition is not really a Failure, wouldn't that be
misleading? Like
On Mon, Dec 11, 2017 at 3:01 PM, wrote:
>
> 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 Fa
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 th
You might want to look at this discussion:
http://www.perlmonks.org/?node_id=87384
by the way it seems like the Intel enginners agree with Perl 6 semantics: a
modulo operation with MOD is undefined if the divisor is zero, with IDIV,
the instruction used by modern gcc, it is an exception (interrup
not what you think:
module operator in % in perl6 is defined as $b - $a * floor($b / $a)
On Mon, Dec 11, 2017 at 10:37 PM, Sean McAfee wrote:
> On Mon, Dec 11, 2017 at 12:56 PM, Darren Duncan
> wrote:
>
>> On 2017-12-11 12:22 PM, Sean McAfee wrote:
>>
>>> Well, not really. I don't think x %%
On Mon, Dec 11, 2017 at 12:56 PM, Darren Duncan
wrote:
> 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.
>>
>> 1 / 0 is an expression which can evaluate to no sensible value, so it
>> makes
>> sense to fail there. By the que
Putting aside the edge case of what to do when the divisor is zero, which could
also be tested for prior to attempting to call the operator:
An "is evenly divisible by" operator is an immensely useful one to have built-in
to the language; not only is "x %% y" much more direct to the real questi
I think that this stems from a confusion between the divisibility problem
in integer number (on a ring) and the divisibility problem resolved by the
perl6 %% operator.
Personally I think that %% is useless while the former is useful and
missing. But I have nothing against useless operators
On Mon
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.
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."
I strongl
On Mon, Dec 11, 2017 at 1:52 AM, Elizabeth Mattijsen wrote:
> > On 11 Dec 2017, at 04:42, Sean McAfee 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? A
> On 11 Dec 2017, at 04:42, Sean McAfee wrote:
>
> I 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 at line 1
>
> The docs say a %% b is True if a % b i
I 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 at 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 mor
# New Ticket Created by "Carl Mäsak"
# Please include the string: [perl #69310]
# in the subject line of all future correspondence about this issue.
# http://rt.perl.org/rt3/Ticket/Display.html?id=69310 >
rakudo: say 1/0; say "Alive"; say (1/0).Num
rakudo 0eaf62: OUTPUT«AliveDivide by zero
13 matches
Mail list logo