Documentation of 'math.jwave.tools.AncientEgyptianMultiplication' Java class
AncientEgyptianMultiplication
math.jwave.tools

Class AncientEgyptianMultiplication



  • public class AncientEgyptianMultiplication
    extends java.lang.Object
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      int compose(int[] ancientEgyptianMultipliers)
      The method converts a list of ancient Egyptian multipliers to the corresponding integer.
      int[] decompose(int number)
      The method converts a positive integer to the ancient Egyptian multipliers which are actually the multipliers to display the number by a sum of the largest possible powers of two.
      int getExponent(double f)
      Replaced Math.getExponent due to google's Android OS is not supporting it in Math library.
      double scalb(double f, int scaleFactor)
      Replaced Math.scalb due to google's Android OS is not supporting it in Math library.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AncientEgyptianMultiplication

        public AncientEgyptianMultiplication()
        Some how useless ~8>
    • Method Detail

      • decompose

        public int[] decompose(int number)
                        throws JWaveException
        The method converts a positive integer to the ancient Egyptian multipliers which are actually the multipliers to display the number by a sum of the largest possible powers of two. E.g. 42 = 2^5 + 2^3 + 2^1 = 32 + 8 + 2. However, odd numbers always 2^0 = 1 as the last entry. Also see: http://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication
        Parameters:
        number -
        Returns:
        Throws:
        JWaveException
      • compose

        public int compose(int[] ancientEgyptianMultipliers)
                    throws JWaveException
        The method converts a list of ancient Egyptian multipliers to the corresponding integer. The ancient Egyptian multipliers are actually the multipliers to display am integer by a sum of the largest possible powers of two. E.g. 42 = 2^5 + 2^3 + 2^1 = 32 + 8 + 2. Also see: http://en.wikipedia.org/wiki/Ancient_Egyptian_multiplication
        Parameters:
        ancientEgyptianMultipliers - an integer array keeping the ancient Egyptian multipliers
        Returns:
        resulting integer as sum of powers of two
        Throws:
        JWaveException
      • getExponent

        public int getExponent(double f)
        Replaced Math.getExponent due to google's Android OS is not supporting it in Math library.
        Parameters:
        f -
        Returns:
        p of 2^p <= f < 2^(p+1)
      • scalb

        public double scalb(double f,
                            int scaleFactor)
        Replaced Math.scalb due to google's Android OS is not supporting it in Math library.
        Parameters:
        f -
        scaleFactor -
        Returns:
        f times 2^(scaleFactor)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.