use Test::More *; my $x=9; my $y=3.14; is(''+(-5).tora(), "-5"); is(''+(-$x).tora(), "-9"); is(''+$y.tora(), "3.14"); is(''+(-$y).tora(), "-3.14"); is(''+(-(-$y)).tora(), "3.14"); note('&&'); is(false && false, false); is(false && true, false); is(true && false, false); is(true && true, true); # do not run the rhs when lhs is false value is(false && fail(), false); # || note("# ||"); is(false || false, false); is(false || true, true); is(true || false, true); is(true || true, true); # do not run the rhs when lhs is true value is(true || fail(), true); note('**'); is(''+3**3, 27); is(''+(3**3.1), '30.1353256989154'); is(''+3.2**3.1, '36.8099250183523'); is(4649 & 5963, 4617); is(4649 | 5963, 5995); is(4649 ^ 5963, 1378); note('bit shift') is(1<<3, 8); is(128>>1, 64); note('%') is(13 % 4, 1); is(-13 % 4, 3); is(-13 % -4, -1); done_testing();