#!/usr/bin/env perl use utf8; use Utils; use strict; use warnings; sub exponentiation { my ($base, $powerArg) = @_; my $power = $powerArg; my $result = 1; while ($power > 0) { $result *= $base; --$power; } return $result; } MAIN: { binmode(STDOUT, ":utf8"); binmode(STDERR, ":utf8"); binmode(STDIN, ":utf8"); for (my $b = 1.1; $b < 2.05; $b += 0.1) { for (my $p = 2; $p <= 10; ++$p) { print Utils::messageFormat("\{0:f\} ^ \{1:d\} = \{2:f\}", $b, $p, exponentiation($b, $p)), "\n"; } } }