quaeratin
Version:
An extended precision floating point library (as per Shewchuk) - precision only limited by overflow / underflow
18 lines (17 loc) • 765 B
TypeScript
/**
* Returns the result of a/b using Goldschmidt division.
*
* The result will only be exact if b|a, i.e. if b divides a exactly, else the
* result will be rounded to the longest bitlength between a and b.
*
* @param a the numerator
* @param b the denominator
*
* @param expansionLength the bitlength/53 of the final result, e.g. 1 means
* standard double precision, 2 means double-double, etc up to a max of about 20 at
* which point underflow cease precision improvement. If the division is known
* to be exact beforehand (such as in the pseudo remainder sequence algorithm)
* then set expansionLength === 0 and an exact division will be done.
*/
declare function eDiv(N: number[], D: number[], expansionLength: number): number[];
export { eDiv };