Polynomial long division: Difference between revisions

Content added Content deleted
(Updated D entry)
(Updated D entry)
Line 690: Line 690:


Tuple!(double[], double[]) polyDiv(in double[] inN, in double[] inD)
Tuple!(double[], double[]) polyDiv(in double[] inN, in double[] inD)
pure /*nothrow*/ {
pure nothrow {
// Code smell: a function that does two things.
// Code smell: a function that does two things.
static int trimAndDegree(T)(ref T[] poly) nothrow pure {
static int trimAndDegree(T)(ref T[] poly) nothrow pure {
Line 697: Line 697:
}
}


double[] N = inN.dup; // Not nothrow.
double[] N = inN.dup;
const(double)[] D = inD;
const(double)[] D = inD;
const dD = trimAndDegree(D);
const dD = trimAndDegree(D);