Skip to content

Commit

Permalink
Tests raising small integers to the power of very large integers.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Apr 9, 2013
1 parent 64c7348 commit 9c1a668
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S32-num/power.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 43;
plan 50;

# Real **
is(0 ** 0, 1, "0 ** 0 == 1");
Expand All @@ -12,6 +12,16 @@ is(4 ** 0, 1, "4 ** 0 == 1");
is(4 ** 1, 4, "4 ** 1 == 4");
is(4 ** 2, 16, "4 ** 2 == 16");

is 0 ** 4553535345364535345634543534, 0, "0 ** 4553535345364535345634543534 == 0";
is 1 ** 4553535345364535345634543534, 1, "1 ** 4553535345364535345634543534 == 1";
#?rakudo 2 todo "Simple bigint optimizations NYI"
is (-1) ** 4553535345364535345634543534, 1, "-1 ** 4553535345364535345634543534 == 1";
is (-1) ** 4553535345364535345634543533, -1, "-1 ** 4553535345364535345634543534 == -1";
is 2 ** 4553535345364535345634543534, Inf, "2 ** 4553535345364535345634543534 == Inf";
#?rakudo todo "Simple bigint optimizations NYI"
is (-2) ** 4553535345364535345634543534, Inf, "-2 ** 4553535345364535345634543534 == Inf";
is (-2) ** 4553535345364535345634543533, -Inf, "-2 ** 4553535345364535345634543534 == -Inf";

is(4 ** 0.5, 2, "4 ** .5 == 2");
is(4 ** (1/2), 2, "4 ** (1/2) == 2 ");
is(4 ** (-1/2), 0.5, "4 ** (-1/2) == 1/2 ");
Expand Down

0 comments on commit 9c1a668

Please sign in to comment.