=begin pod

=head1 Numeric

    role Numeric { ... }

Common role for numbers and types that can act as numbers.

=head2 Methods

=head3 ACCEPTS

    multi method ACCEPTS(Numeric:D: $other)

Returns True if C<$other> is numerically the same as the invocant.

=head3 log

    multi sub    log(Numeric:D, Numeric $base = e) returns Numeric:D
    multi method log(Numeric:D: Numeric $base = e) returns Numeric:D

Calculates the logarithm to base C<$base>. Defaults to the natural logarithm.

=head3 log10

    multi sub    log10(Numeric:D ) returns Numeric:D
    multi method log10(Numeric:D:) returns Numeric:D

Calculates the logarithm to base 10.

=head3 exp

    multi sub    exp(Numeric:D, Numeric:D $base = e) returns Numeric:D
    multi method exp(Numeric:D: Numeric:D $base = e) returns Numeric:D

Returns C<$base> to the power of the number, or C<e> to the power of the
number if called without a second argument.

=head3 roots

    multi method roots(Numeric:D: Int:D $n) returns Positional

Returns a list of the C<$n> complex roots, which evaluate to the original
number when raised to the C<$n>th power.

=head3 abs

    multi sub    abs(Numeric:D ) returns Real:D
    multi method abs(Numeric:D:) returns Real:D

Returns the absolute value of the number.

=head3 sqrt

    mulit sub    sqrt(Numeric:D) returns Numeric:D
    mulit method sqrt(Numeric:D) returns Numeric:D

Returns a square root of the number. For real numbers the positive square
root is returned.

On negative real numbers, C<sqrt> returns C<NaN> rather than a complex number,
in order to not confuse people who are not familiar with complex arithemtic.
If you want to calculate complex square roots, coerce to C<Complex> first, or
use the C<roots> method.

=head3 conj

    multi method conj(Numeric:D) returns Numeric:D

Returns the complex conjugate of the number. Returns the number itself for
real numbers.

=head3 Bool

    multi method Bool(Numeric:D:)

Returns C<False> if the number is equivalent to zero, and C<True> otherwise.

=head3 succ

    method succ(Numerid:D:)

Returns the number incremented by one (successor).

=head3 pred

    method pred(Numerid:D:)

Returns the number decremented by one (predecessor).

=end pod
