/** * Returns the exponential number <i>e</i> raised to the power of this * number. * * @return <code>exp(this)</code>. */ public Float64 exp() { Float64 r = FACTORY.object(); r._value = MathLib.exp(this._value); return r; }
/** * Returns the value of the first argument raised to the power of the * second argument. * * @param x the base. * @param y the exponent. * @return <code>x<sup>y</sup></code> **/ public static double pow(double x, double y) { // Use close approximation (+/- LSB) if ((x < 0) && (y == (int) y)) return (((int) y) & 1) == 0 ? pow(-x, y) : -pow(-x, y); return MathLib.exp(y * MathLib.log(x)); }
/** * Returns the value of the first argument raised to the power of the * second argument. * * @param x the base. * @param y the exponent. * @return <code>x<sup>y</sup></code> **/ public static double pow(double x, double y) { // Use close approximation (+/- LSB) if ((x < 0) && (y == (int) y)) return (((int) y) & 1) == 0 ? pow(-x, y) : -pow(-x, y); return MathLib.exp(y * MathLib.log(x)); }
/** * Returns the value of the first argument raised to the power of the * second argument. * * @param x the base. * @param y the exponent. * @return <code>x<sup>y</sup></code> **/ public static double pow(double x, double y) { // Use close approximation (+/- LSB) if ((x < 0) && (y == (int) y)) return (((int) y) & 1) == 0 ? pow(-x, y) : -pow(-x, y); return MathLib.exp(y * MathLib.log(x)); }
/** * Returns the exponential number <i>e</i> raised to the power of * this complex. * Note: <code><i><b>e</b></i><sup><font size=+0><b>PI</b>*<i><b>i * </b></i></font></sup> = -1</code> * * @return <code>exp(this)</code>. */ public Complex exp() { Complex c = FACTORY.object(); double m = MathLib.exp(this._real); c._real = m * MathLib.cos(this._imaginary); c._imaginary = m * MathLib.sin(this._imaginary); return c; }
/** * Returns this complex raised to the power of the specified complex * exponent. * * @param that the exponent. * @return <code>this**that</code>. */ public Complex pow(Complex that) { Complex c = FACTORY.object(); double r1 = MathLib.log(this.magnitude()); double i1 = this.argument(); double r2 = (r1 * that._real) - (i1 * that._imaginary); double i2 = (r1 * that._imaginary) + (i1 * that._real); double m = MathLib.exp(r2); c._real = m * MathLib.cos(i2); c._imaginary = m * MathLib.sin(i2); return c; }