/** * Returns the decimal logarithm of the specified value. * * @param x the value greater than <code>0.0</code>. * @return the value y such as <code>10<sup>y</sup> == x</code> **/ public static double log10(double x) { return log(x) * INV_LOG10; } private static double INV_LOG10 = 0.43429448190325182765112891891661;
/** * Returns the decimal logarithm of the specified value. * * @param x the value greater than <code>0.0</code>. * @return the value y such as <code>10<sup>y</sup> == x</code> **/ public static double log10(double x) { return log(x) * INV_LOG10; }
/** * Returns the decimal logarithm of the specified value. * * @param x the value greater than <code>0.0</code>. * @return the value y such as <code>10<sup>y</sup> == x</code> **/ public static double log10(double x) { return log(x) * INV_LOG10; }
/** * Returns the decimal logarithm of the specified value. * * @param x the value greater than <code>0.0</code>. * @return the value y such as <code>10<sup>y</sup> == x</code> **/ public static double log10(double x) { return log(x) * INV_LOG10; }
/** * Returns the natural logarithm (base e) of this number. * * @return <code>log(this)</code>. */ public Float64 log() { Float64 r = FACTORY.object(); r._value = MathLib.log(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 java.lang.Math value. if (true) return Math.pow(x, y); /**/ /**/ // Else (J2ME) 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 principal natural logarithm (base e) of this complex. * Note: There are an infinity of solutions. * * @return <code>log(this)</code>. */ public Complex log() { Complex c = FACTORY.object(); c._real = MathLib.log(this.magnitude()); c._imaginary = this.argument(); return c; }
/** * 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 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; }