import { exponent } from "big-float-ts"; import { bitLength } from "big-float-ts"; /** * Returns the result of scaling the given floats by the *same* power of two * such that all floats become integers (bar overflow). * * * the result is exact (no round-off can occur, but overflow can) * * can be used to scale polynomials or Shewchuk expansions * * @param as an array of double precision floating point numbers * * @doc */ function scaleFloatsToInts(as: number[]): number[] { let e = -1024; for (let i=0; i e) { e = scaleFactor; } } return as.map(a => a*2**e); } export { scaleFloatsToInts }