Examples of mod()


Examples of net.i2p.util.NativeBigInteger.mod()

     
      BigInteger X = new NativeBigInteger(1, Wbuf);
     
      // 9: Let c = X mod 2q. Set p = X - ( c - 1 ). Therefore p mod 2q = 1.
     
      BigInteger c = X.mod(q.add(q));
      BigInteger p = X.subtract(c.subtract(BigInteger.ONE));
     
      if(p.bitLength() >= keyLength-1) {
        if(isPrime(p)) {
          finish(r, hashLength, new NativeBigInteger(p), new NativeBigInteger(q), seed, counter);
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.mod()

        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
View Full Code Here

Examples of org.apache.velocity.tools.generic.MathTool.mod()

        /* getTotal() watches the type of its first argument, so assertEquals needs a long */
        assertEquals((long)7,mathTool.getTotal(new long[] {2,2,3}));
        assertEquals(8,mathTool.idiv(130,16));
        assertEquals(9,mathTool.max(9,-10));
        assertEquals(10,mathTool.min(10,20));
        assertEquals(11,mathTool.mod(37,13));
        assertEquals(12,mathTool.mul(3,4));
        assertEquals(13,mathTool.round(12.8));
        assertEquals(14.2,mathTool.roundTo(1,14.18));
        assertEquals(-5.0,mathTool.roundTo(2,-4.999));
        assertEquals(15,mathTool.sub(30,15));
View Full Code Here

Examples of org.ethereum.vm.DataWord.mod()

    }
    two[31] = 0x56; // 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff56
   
    DataWord x = new DataWord(one);// System.out.println(x.value());
    DataWord y = new DataWord(two);// System.out.println(y.value());
    y.mod(x);
    assertEquals(32, y.getData().length);
    assertEquals(expected, Hex.toHexString(y.getData()));
  }
 
  @Test
View Full Code Here

Examples of org.jpox.store.mapped.expression.ScalarExpression.mod()

            {
                expr = expr.div(compileUnaryExpression());
            }
            else if (p.parseChar('%'))
            {
                expr = expr.mod(compileUnaryExpression());
            }
            else
            {
                break;
            }
View Full Code Here

Examples of org.luaj.vm2.LuaValue.mod()

      break;
    case OP_DIV:
      r = v1.div(v2);
      break;
    case OP_MOD:
      r = v1.mod(v2);
      break;
    case OP_POW:
      r = v1.pow(v2);
      break;
    case OP_UNM:
View Full Code Here

Examples of org.rabinfingerprint.polynomial.Polynomial.mod()

  private void precomputePopTable() {
    for (int i = 0; i < 256; i++) {
      Polynomial f = Polynomial.createFromLong(i);
      f = f.shiftLeft(BigInteger.valueOf(bytesPerWindow * 8));
      f = f.mod(poly);
      popTable[i] = f.toBigInteger().longValue();
    }
  }

  @Override
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.