<commit_before>augment class Any {
    multi method abs() {
        pir::abs__Nn(self.Num);
    }

    multi method exp() {
        self.Num.exp;
    }

    our Int multi method ceiling() is export {
        pir::box__PI(pir::ceil__IN(self))
    }

    our Str multi method chr() {
        ~(pir::chr__SI(self))
    }

    multi method cis() {
        1.unpolar(self)
    }

    our Int multi method floor() is export {
        pir::box__PI(pir::floor__IN(self))
    }

    our Int multi method truncate() is export {
        self == 0 ?? 0 !! self < 0  ?? self.ceiling !! self.floor
    }

    our Num method rand() {
        pir::box__PN(pir::rand__NN(self))
    }

    multi method roots($n) {
        $.Complex.roots($n);
    }

    our Int multi method round() is export {
        (self + 0.5).Num.floor;
    }

    multi method sqrt() {
        self.Num.sqrt;
    }

    INIT {
        our @trig-base-conversions = (1.0, pi / 180.0, pi / 200.0, 2.0 * pi);
    }

    # Used by the :Trig subs and methods in the Int and Num classes.
    our multi method !to-radians($base) {
        self * pir::get_global__Ps('@trig-base-conversions')[$base];
    }

    our multi method !from-radians($base) {
        self / pir::get_global__Ps('@trig-base-conversions')[$base];
    }

    multi method log() {
        $.Num.log;
    }

    multi method log($base) {
        $.Num.log($base);
    }

    multi method log10() {
        $.Num.log10;
    }

    our Num multi method sin($base = Radians) {
        self.Num.sin($base);
    }

    our Num multi method cos($base = Radians) {
        self.Num.cos($base);
    }

    our Num multi method tan($base = Radians) {
        self.Num.tan($base);
    }

    our Num multi method sec($base = Radians) {
         self.Num.sec($base);
    }

    our Num multi method cosec($base = Radians) {
        self.Num.cosec($base);
    }

    our Num multi method cotan($base = Radians) {
        self.Num.cotan($base);
    }

    our Num multi method sinh($base = Radians) {
        self.Num.sinh($base);
    }

    our Num multi method cosh($base = Radians) {
        self.Num.cosh($base);
    }

    our Num multi method tanh($base = Radians) {
        self.Num.tanh($base);
    }

    our Num multi method sech($base = Radians) {
        self.Num.sech($base);
    }

    our Num multi method cosech($base = Radians) {
        self.Num.cosech($base);
    }

    our Num multi method cotanh($base = Radians) {
        self.Num.cotanh($base);
    }

    our Num multi method asin($base = Radians) {
        self.Num.asin($base);
    }

    our Num multi method acos($base = Radians) {
        self.Num.acos($base);
    }

    our Num multi method atan($base = Radians) {
        self.Num.atan($base);
    }

    our Num multi method atan2($x = 1, $base = Radians) {
        self.Num.atan2($x.Num, $base);
    }

    our Num multi method asec($base = Radians) {
        self.Num.asec($base);
    }

    our Num multi method acosec($base = Radians) {
        self.Num.acosec($base);
    }

    our Num multi method acotan($base = Radians) {
        self.Num.acotan($base);
    }

    our Num multi method asinh($base = Radians) {
        self.Num.asinh($base);
    }

    our Num multi method acosh($base = Radians) {
        self.Num.acosh($base);
    }

    our Num multi method atanh($base = Radians) {
        self.Num.atanh($base);
    }

    our Num multi method asech($base = Radians) {
        self.Num.asech($base);
    }

    our Num multi method acosech($base = Radians) {
        self.Num.acosech($base);
    }

    our Num multi method acotanh($base = Radians) {
        self.Num.acotanh($base);
    }

    our ::Complex multi method unpolar($angle) {
        Complex.new(self.Num * $angle.cos("radians"), self.Num * $angle.sin("radians"));
    }
}

our proto sub abs($x) { $x.abs }
our multi sub prefix:<abs>($x) { $x.abs }
our proto sub exp($exponent) { $exponent.exp }
our proto sub log($x) { $x.log }
our multi sub log($x, $base) { $x.log($base) }
our proto sub log10($x) { $x.log10 }
our proto sub cis($angle) { $angle.cis; }
our proto sub unpolar($mag, $angle) { $mag.unpolar($angle); }

# jnthn says that we should have both the multi sub declaration and the proto.

our multi sub sin($x, $base = Radians) {
    $x.sin($base)
}

our proto sin($x, $base = Radians) {
    sin($x, $base)
}

our multi sub asin($x, $base = Radians) {
    $x.asin($base)
}

our proto asin($x, $base = Radians) {
    asin($x, $base)
}

our multi sub cos($x, $base = Radians) {
    $x.cos($base)
}

our proto cos($x, $base = Radians) {<commit_msg>Switch Any and proto sub versions of log to use $base with a default of e, rather than having separate versions with and without $base.<commit_after>augment class Any {
    multi method abs() {
        pir::abs__Nn(self.Num);
    }

    multi method exp() {
        self.Num.exp;
    }

    our Int multi method ceiling() is export {
        pir::box__PI(pir::ceil__IN(self))
    }

    our Str multi method chr() {
        ~(pir::chr__SI(self))
    }

    multi method cis() {
        1.unpolar(self)
    }

    our Int multi method floor() is export {
        pir::box__PI(pir::floor__IN(self))
    }

    our Int multi method truncate() is export {
        self == 0 ?? 0 !! self < 0  ?? self.ceiling !! self.floor
    }

    our Num method rand() {
        pir::box__PN(pir::rand__NN(self))
    }

    multi method roots($n) {
        $.Complex.roots($n);
    }

    our Int multi method round() is export {
        (self + 0.5).Num.floor;
    }

    multi method sqrt() {
        self.Num.sqrt;
    }

    INIT {
        our @trig-base-conversions = (1.0, pi / 180.0, pi / 200.0, 2.0 * pi);
    }

    # Used by the :Trig subs and methods in the Int and Num classes.
    our multi method !to-radians($base) {
        self * pir::get_global__Ps('@trig-base-conversions')[$base];
    }

    our multi method !from-radians($base) {
        self / pir::get_global__Ps('@trig-base-conversions')[$base];
    }

    multi method log($base = e) {
        $.Num.log($base);
    }

    multi method log10() {
        $.Num.log10;
    }

    our Num multi method sin($base = Radians) {
        self.Num.sin($base);
    }

    our Num multi method cos($base = Radians) {
        self.Num.cos($base);
    }

    our Num multi method tan($base = Radians) {
        self.Num.tan($base);
    }

    our Num multi method sec($base = Radians) {
         self.Num.sec($base);
    }

    our Num multi method cosec($base = Radians) {
        self.Num.cosec($base);
    }

    our Num multi method cotan($base = Radians) {
        self.Num.cotan($base);
    }

    our Num multi method sinh($base = Radians) {
        self.Num.sinh($base);
    }

    our Num multi method cosh($base = Radians) {
        self.Num.cosh($base);
    }

    our Num multi method tanh($base = Radians) {
        self.Num.tanh($base);
    }

    our Num multi method sech($base = Radians) {
        self.Num.sech($base);
    }

    our Num multi method cosech($base = Radians) {
        self.Num.cosech($base);
    }

    our Num multi method cotanh($base = Radians) {
        self.Num.cotanh($base);
    }

    our Num multi method asin($base = Radians) {
        self.Num.asin($base);
    }

    our Num multi method acos($base = Radians) {
        self.Num.acos($base);
    }

    our Num multi method atan($base = Radians) {
        self.Num.atan($base);
    }

    our Num multi method atan2($x = 1, $base = Radians) {
        self.Num.atan2($x.Num, $base);
    }

    our Num multi method asec($base = Radians) {
        self.Num.asec($base);
    }

    our Num multi method acosec($base = Radians) {
        self.Num.acosec($base);
    }

    our Num multi method acotan($base = Radians) {
        self.Num.acotan($base);
    }

    our Num multi method asinh($base = Radians) {
        self.Num.asinh($base);
    }

    our Num multi method acosh($base = Radians) {
        self.Num.acosh($base);
    }

    our Num multi method atanh($base = Radians) {
        self.Num.atanh($base);
    }

    our Num multi method asech($base = Radians) {
        self.Num.asech($base);
    }

    our Num multi method acosech($base = Radians) {
        self.Num.acosech($base);
    }

    our Num multi method acotanh($base = Radians) {
        self.Num.acotanh($base);
    }

    our ::Complex multi method unpolar($angle) {
        Complex.new(self.Num * $angle.cos("radians"), self.Num * $angle.sin("radians"));
    }
}

our proto sub abs($x) { $x.abs }
our multi sub prefix:<abs>($x) { $x.abs }
our proto sub exp($exponent) { $exponent.exp }
our proto sub log($x, $base = e) { $x.log($base) }
our proto sub log10($x) { $x.log10 }
our proto sub cis($angle) { $angle.cis; }
our proto sub unpolar($mag, $angle) { $mag.unpolar($angle); }

# jnthn says that we should have both the multi sub declaration and the proto.

our multi sub sin($x, $base = Radians) {
    $x.sin($base)
}

our proto sin($x, $base = Radians) {
    sin($x, $base)
}

our multi sub asin($x, $base = Radians) {
    $x.asin($base)
}

our proto asin($x, $base = Radians) {
    asin($x, $base)
}

our multi sub cos($x, $base = Radians) {
    $x.cos($base)
}

our proto cos($x, $base = Radians) {
{'fraction_non_alphanumeric': 0.15002175805047868, 'fraction_numerical': 0.006309834638816362, 'mean_word_length': 2.2109675165909883, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6095321', 'n_tokens_mistral': 3328, 'n_tokens_neox': 3168, 'n_words': 823}