
import { eDiff } from "./e-diff.js";
import { eSign } from "./e-sign.js";


/**
 * Returns 0 if a === b, a +tive value if a > b or a negative value if a < b.
 * 
 * * see [Shewchuk](https://people.eecs.berkeley.edu/~jrs/papers/robustr.pdf)
 * 
 * "The easiest way to compare two expansions is to subtract one from the other, 
 * and test the sign of the result. An expansion’s sign can be easily tested 
 * because of the nonoverlapping property; simply check the sign of the 
 * expansion's most significant nonzero component..."
 * 
 * @param a a floating point expansion
 * @param b another floating point expansion
 */
function eCompare(a: number[], b: number[]) {
    return eSign(eDiff(a,b));
}


export { eCompare }
