UNPKG

@princedev/calculate

Version:

Fast, lightweight, and extinsible mathematical and statistical functions.

24 lines (23 loc) 542 B
export interface IRoot { firstRoot: number; secondRoot: number; } /** * @name quadratic * @summary Returns the root. * * @description Returns the first and second root of a quadratice equation * * @example * // Normal usage * let result = root(4,4,1); * // => {firstRoot: -0.5, secondRoot: -0.5} * * @param {number} a * @param {number} b * @param {number} c * @returns {IRoot} the resulting root. * * @function pure */ export default function quadratic(a: number, b: number, c: number): IRoot;