Class DoubleCRTMath

    • Constructor Summary

      Constructors 
      Constructor Description
      DoubleCRTMath​(int radix)
      Creates a carry-CRT math using the specified radix.
    • Constructor Detail

      • DoubleCRTMath

        public DoubleCRTMath​(int radix)
        Creates a carry-CRT math using the specified radix.
        Parameters:
        radix - The radix that will be used.
    • Method Detail

      • multiply

        public final void multiply​(double[] src,
                                   double factor,
                                   double[] dst)
        Multiplies two words by one word to produce a result of three words. Most significant word is stored first.
        Parameters:
        src - Source array, first multiplicand.
        factor - Second multiplicand.
        dst - Destination array.
      • compare

        public final double compare​(double[] src1,
                                    double[] src2)
        Compares three words. Most significant word is stored first.
        Parameters:
        src1 - First operand.
        src2 - Second operand.
        Returns:
        Less than zero if src1 < src2, greater than zero if src1 > src2 and zero if src1 == src2.
      • add

        public final double add​(double[] src,
                                double[] srcDst)
        Adds three words. Most significant word is stored first.
        Parameters:
        src - First operand.
        srcDst - Second operand, and destination of the operation.
        Returns:
        Overflow carry bit.
      • subtract

        public final void subtract​(double[] src,
                                   double[] srcDst)
        Subtracts three words. Most significant word is stored first.
        Parameters:
        src - First operand.
        srcDst - Second operand, and destination of the operation.
      • divide

        public final double divide​(double[] srcDst)
        Divides three words by the base to produce two words. Most significant word is stored first.
        Parameters:
        srcDst - Source and destination of the operation.
        Returns:
        Remainder of the division.