// Mostly used to make skew vars... void varpower::var(int v, int e, intarray &result) { if (e == 0) result.append(1); else { check_var(v,e); // Sets ERROR if a problem... result.append(3); result.append(v); result.append(e); } }
void varpower::power(const int *a, int n, intarray &result) { if (n == 0) { result.append(1); return; } int *result_vp = result.alloc(*a); *result_vp++ = *a; for (index_varpower i = a; i.valid(); ++i) { *result_vp++ = i.var(); *result_vp++ = safe::mult(i.exponent(),n); } }
// Used in 2 places void varpower::one(intarray &result) { result.append(1); }