Package java.math

Examples of java.math.BigInteger.multiply()


      // the number of milliseconds since 15 October 1582
      BigInteger countMillis = current.subtract(COUNT_START);

      // the result
      count = countMillis.multiply(BigInteger.valueOf(10000));

      String bitString = count.toString(2);
      if (bitString.length() < 60) {
          int nbExtraZeros = 60 - bitString.length();
          String extraZeros = new String();
View Full Code Here


        {
          /* Generate a token for this Storage node */                      
            String guid = GuidGenerator.guid();
            BigInteger token = StorageService.hash(guid);
            if ( token.signum() == -1 )
                token = token.multiply(BigInteger.valueOf(-1L));

            int generation = 1;

            String key = FBUtilities.getHostName();
            row = new Row(key);
View Full Code Here

      if(currentValueByte<0){
        // EOF reached!
        return null;
      }
      final BigInteger currentValue = BigInteger.valueOf(currentValueByte);
      result = result.add(currentValue.multiply(factor));
      factor = factor.multiply(BYTE);
      remainingBits-=8;
    }
    return result;
  }
View Full Code Here

    public BigIntegerToken getRandomToken()
    {
        String guid = GuidGenerator.guid();
        BigInteger token = FBUtilities.hash(guid);
        if ( token.signum() == -1 )
            token = token.multiply(BigInteger.valueOf(-1L));
        return new BigIntegerToken(token);
    }

    private final Token.TokenFactory<BigInteger> tokenFactory = new Token.TokenFactory<BigInteger>() {
        public byte[] toByteArray(Token<BigInteger> bigIntegerToken)
View Full Code Here

   * @return the factorial for n
   */
  private static BigInteger getFactorial(int n) {
    BigInteger fact = BigInteger.ONE;
    for (int i = n; i > 1; i--) {
      fact = fact.multiply(new BigInteger(Integer.toString(i)));
    }
    return fact;
  }

  /**
 
View Full Code Here

  private static BigInteger getFactorial(int n, int k) {
    if (k > n)
      return null;
    BigInteger fact = BigInteger.ONE;
    for (int i = n, j = 0; j < k; i--, j++) {
      fact = fact.multiply(new BigInteger(Integer.toString(i)));
    }
    return fact;
  }

}
View Full Code Here

  //------------------

  private static BigInteger getFactorial (int n) {
    BigInteger fact = BigInteger.ONE;
    for (int i = n; i > 1; i--) {
      fact = fact.multiply (new BigInteger (Integer.toString (i)));
    }
    return fact;
  }

  //--------------------------------------------------------
View Full Code Here

        BigInteger k2p    = k;
        while (e != 0) {
            if ((e & 0x1) != 0) {
                result = result.multiply(k2p);
            }
            k2p = k2p.multiply(k2p);
            e = e >> 1;
        }

        return result;
View Full Code Here

        BigInteger k2p    = k;
        while (!BigInteger.ZERO.equals(e)) {
            if (e.testBit(0)) {
                result = result.multiply(k2p);
            }
            k2p = k2p.multiply(k2p);
            e = e.shiftRight(1);
        }

        return result;
View Full Code Here

     */
    public void setFontSize(int size) {
        BigInteger bint=new BigInteger(""+size);
        CTRPr pr = run.isSetRPr() ? run.getRPr() : run.addNewRPr();
        CTHpsMeasure ctSize = pr.isSetSz() ? pr.getSz() : pr.addNewSz();
        ctSize.setVal(bint.multiply(new BigInteger("2")));
    }

    /**
     * This element specifies the amount by which text shall be raised or
     * lowered for this run in relation to the default baseline of the
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.