Skip to content

Commit

Permalink
Cover rat-to-large-power failurage in SAP
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Jul 31, 2018
1 parent d36e398 commit 89cdc62
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion APPENDICES/A01-limits/overflow.t
Expand Up @@ -3,7 +3,7 @@ use lib $?FILE.IO.parent(3).add("packages");
use Test;
use Test::Util;

plan 11;
plan 15;

# RT #125938
throws-like '2**10000000000', X::Numeric::Overflow,
Expand Down Expand Up @@ -45,4 +45,16 @@ is_run 「start { sleep 2; say ‘pass’; exit }; EVAL ‘say 1.0000001 ** (10
throws-like 'say 1.0000001 ** (10 ** 90000)',
X::Numeric::Overflow, "raising a Rat to a very large number throws";

# https://github.com/rakudo/rakudo/commit/d1729da26a
{
fails-like <1/50000000000000> ** 5000000000000, X::Numeric::Overflow,
'rat (small nu / large de) to large power';
fails-like <1/50000000000000> ** -5000000000000, X::Numeric::Underflow,
'rat (small nu / large de) to large negative power';
fails-like <50000000000000/1> ** 5000000000000, X::Numeric::Overflow,
'rat (large nu / small de) to large power';
fails-like <50000000000000/1> ** -5000000000000, X::Numeric::Underflow,
'rat (large nu / small de) to large negative power';
}

# vim: ft=perl6

0 comments on commit 89cdc62

Please sign in to comment.