math.interface

class tinychain.math.interface.Boolean[source]

Bases: Interface

logical_and(other)[source]

Return True where both this Boolean and the other are True.

logical_not()[source]

Return True where this Boolean is False and vice-versa.

logical_or(other)[source]

Return True where this Boolean or the other is True.

logical_xor(other)[source]

Return True where either this Boolean or the other is True, but not both.

class tinychain.math.interface.Complex[source]

Bases: Numeric

angle()[source]

Return the angle of this Complex number with respect to the origin of the complex plane.

The angle is given in radians.

property imag

The imaginary component of this Complex Numeric

property real

The real component of this Complex Numeric

class tinychain.math.interface.Numeric[source]

Bases: Interface

abs()[source]

Absolute value

add(other)[source]

Addition

div(other)[source]

Division

exp()[source]

Raise e to the power of this Numeric.

log(base=None)[source]

Calculate the logarithm of this Numeric with respect to the given base.

If no base is given, this will return the natural logarithm (base e).

modulo(other)[source]

Return the remainder of self divided by other.

mul(other)[source]

Multiplication

pow(other)[source]

Raise this Numeric to the given power.

round(digits=None)[source]

Round this Numeric to the given number of digits from the decimal point.

If digits is not specified, this will round to the nearest integer.

property shape

The shape of this Numeric state

sub(other)[source]

Subtraction

class tinychain.math.interface.Trigonometric[source]

Bases: Interface

acos()[source]

Arccosine

acosh()[source]

Hyperbolic arccosine

asin()[source]

Arcsine

asinh()[source]

Hyperbolic arcsine

atan()[source]

Arctangent

atanh()[source]

Hyperbolic arctangent

cos()[source]

Cosine

cosh()[source]

Hyperbolic cosine

sin()[source]

Sine

sinh()[source]

Hyperbolic sine

tan()[source]

Tangent

tanh()[source]

Hyperbolic tangent

classmethod trig_rtype()[source]