Skip to content

Instantly share code, notes, and snippets.

@timo
Last active December 18, 2015 16:58
Show Gist options
  • Save timo/6147b62c22b4ac7a6673 to your computer and use it in GitHub Desktop.
Save timo/6147b62c22b4ac7a6673 to your computer and use it in GitHub Desktop.
use Test;
my $a = 10 div 0; ok $a.WHAT === Failure, "10 div 0";
my $b = 10 / 0; ok $b.WHAT === Rat, "10 / 0 is a Rat.";
my $c = 10 / 0.0; ok $c.WHAT === Rat, "10 / 0.0";
my $d = 10 / 0e0; ok $d.WHAT === Failure, "10 / 0e0";
my $e = (1/1) / 0e0; ok $e.WHAT === Failure, "(1/1) / 0e0";
my $f = 1e0 / (0/1); ok $f.WHAT === Failure, "1e0 / (0/1)";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment