text: static public double IPMT(double r, int per, int nper, double pv, double fv, int type){double ipmt = FV(r, per - 1, PMT(r, nper, pv, fv, type), pv, type) * r;if (type == 1) ipmt /= (1 + r);return ipmt;}