FullMath

Handles core maths for multiplication, division, and quadratic root.

GitHub File: fullMath.ts

Constructor

Private constructor that cannot be constructed.

Methods

mulDivRoundingUp() - public static

Divides the product of the params by the given denominator and rounds up to the nearest integer.

result=abdenominatorresult=\lceil{\frac{a{\cdot}b}{denominator}}\rceil

Parameters

ParamsTypeDescription

a

The multiplicand.

b

The multiplier.

denominator

Denominator to divide the product of the multiplicand and multiplier.

Returns

TypeDescription

Product of a and b divided by the denominator. Rounded up to the nearest integer.


mulDiv() - public static

Divides the product of the params by the given denominator.

result=abdenominatorresult=\frac{a{\cdot}b}{denominator}

Parameters

ParamsTypeDescription

a

First parameter to multiply.

b

Second parameter to multiply.

Returns

TypeDescription

Product of a and b divided by the denominator.


getSmallerRootOfQuadEqn() - public static

Returns the smaller root of a quadratic equation.

result=bb2acaresult = \frac{b-{\sqrt{{b^2}-ac}}}{a}

Parameters

ParamsTypeDescription

a

First quadratic coefficient.

b

Second quadratic coefficient.

c

Third quadratic coefficient.

Returns

TypeDescription

Smallest root of the quadratic equation.

Last updated