nresid

void nresid(double* first, double* last, double val, double n)

Replaces the elements in [first, last) with thier deviations from val raised to the n-th power.

Parameters:
firstBeginning iterator for the container of elements.
lastEnding iterator for the container of elements.
valPivot value.
nPower

Returns:
On return, the elements of [first, last) are replaced with thier residuals.

Usage:

double x[] = {1.0, 2.0, 3.0, 4.0};
nresid(x, x + 4, 2.5, 2.0);

Header:
#include "residual.h"