Class Power

    • Field Detail

      • strict

        protected boolean strict
    • Constructor Detail

      • Power

        public Power()
        Standard constructor, Complex results for x < 0, y non integral.
      • Power

        public Power​(boolean strict)
        If strict is true then returns NaN for x < 0, y non integral.
        Parameters:
        strict - true to force real results
    • Method Detail

      • power

        public java.lang.Object power​(java.lang.Number d1,
                                      java.lang.Number d2)
      • power

        public static java.lang.Object power​(Complex c1,
                                             Complex c2)
      • power

        public static java.lang.Object power​(Complex c,
                                             java.lang.Number d)
      • power

        public static java.lang.Object power​(java.lang.Number d,
                                             Complex c)
      • power

        public static double power​(double l,
                                   int n)
        A fast routine for computing integer powers. Code adapted from efficient power by Patricia Shanahan [email protected] Almost identical to the method Knuth gives on page 462 of The Art of Computer Programming Volume 2 Seminumerical Algorithms.
        Parameters:
        l - number to be taken to a power.
        n - power
        Returns:
        x to the power n
      • isAllowComplexResults

        public boolean isAllowComplexResults()
        Whether complex results are allowed for number arguments. If l is a negative Number and r is non integral Number then the pow function typically returns a Complex result. If this flag is set then an EvaluationException would be thrown instead.
        Returns:
        the status of the allowComplexResults flag.
      • setAllowComplexResults

        public void setAllowComplexResults​(boolean allowComplexResults)