Help for this page

Select Code to Download


  1. or download this
    sub zeta($s) { [\+] map -> \n { 1 / n**$s }, 1..* }
    say zeta(2)[1000];
    
  2. or download this
    sub infix:<+>(Irrational $x, Irrational $y) {
        Irrational.new: gather while True {
            (state $n)++;
            take $x[$n] + $y[$n];
        }
    }
    
  3. or download this
    sub infix:<==>(Irrational $x, Irrational $y) {
        while True {
            (state $n)++;
            return $x[$n] == $y[$n];
        }
    }
    
  4. or download this
    package Real;
    
    # the accuracy number below is only for display.
    ...
    print $e + $one, "\n";
    print $e * $e, "\n";
    print ($three + $one) * Arctan(1);