> On 28 Oct 2014, at 21:23, Carl Mäsak (via RT) <perl6-bugs-follo...@perl.org> 
> wrote:
> 
> # New Ticket Created by  "Carl Mäsak" 
> # Please include the string:  [perl #123077]
> # in the subject line of all future correspondence about this issue. 
> # <URL: https://rt.perl.org/Ticket/Display.html?id=123077 >
> 
> 
> <moritz> m: my $x = 1/ 0; $x.gist
> <camelia> rakudo-moar 315ec6: OUTPUT«Type check failed for return
> value; expected 'Int' but got 'Failure' [...]
> <moritz> that looks like a bug to me
> <masak> moritz: agreed.
> <masak> moritz: do you want to rakudobug it, or shall I?
> <moritz> masak: please do
> * masak does, pleased
> <masak> moritz: ooc and for the record, did you expect `my $x = 1/ 0`
> to fail? if so, how? or, if you expected it to succeed, what value did
> you expect in $x ?
> <moritz> masak: I didn't know if it would fail or die
> <moritz> masak: but I expected that if it was a Failure, .gist would
> throw a "division by zero" exception
> <arnsholt> I guess I'd expect $x to either be a Failure or a NaN
> <moritz> arnsholt: since there are no Nums involved, I'd find a NaN rather 
> weird
> <masak> Java has integer 1/0 as a (runtime) error, but float/double
> 1.0/0.0 as a NaN.
> <masak> m: say Rat.new(1, 0).perl
> <camelia> rakudo-moar 315ec6: OUTPUT«<1/0>␤»
> <masak> S03 seems to indicate that that's the intended answer.
> <masak> at least reading it by the letter, and seeing no exception in
> place for integral division by 0.
> <masak> ...except if this implicitly mean that Perl 6 is like Perl 5
> in this regard, in which case it should die with "Illegal division by
> zero" at runtime.
> <moritz> I'm even fine with an <1/0> literal, as long as it .gist()s sensibly
> * masak .oO( rakudo-moar 315ec6: OUTPUT«<1/0>, you knucklehead!␤» )

After 9672c0df736cde4602036e4f6e137b6c4bc7209d :

$ 6 'my $x = 1/ 0; $x.gist'
Divide by zero


Liz

Reply via email to