Examples of clearBit()


Examples of java.math.BigInteger.clearBit()

        BigInteger r;
        do {
            old_r = number.get();
            r = old_r;
            for (int i = 0; i < bits.length; i++)
                r = r.clearBit(bits[i]);
        }
        while (!number.compareAndSet(old_r, r));
        return null;
    }
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        BigInteger r;
        do {
            old_r = number.get();
            r = old_r;
            for (int i = 0; i < bits.length; i++)
                r = r.clearBit(bits[i]);
        }
        while (!number.compareAndSet(old_r, r));
        return Node.createExternal(new External_Integer(old_r));
    }
View Full Code Here

Examples of java.math.BigInteger.clearBit()

                if (bitIndex < 0) {
                    return false;
                }

                return bintValue.clearBit(bitIndex).equals(BigInteger.ZERO);
            }
        };
    }

    /**
 
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        BigInteger temp = this.rp.clearBit(0).clearBit(m);
        this.ks = new int[bitCount-2];
        for (int i = this.ks.length-1; i >= 0; i--) {
            int index = temp.getLowestSetBit();
            this.ks[i] = index;
            temp = temp.clearBit(index);
        }
    }

    /**
     * Creates an elliptic curve characteristic 2 finite
View Full Code Here

Examples of java.math.BigInteger.clearBit()

    byte aBytes[] = {-1, -128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26};
    int aSign = 1;
    int number = -7;
    BigInteger aNumber = new BigInteger(aSign, aBytes);
    try {
      aNumber = aNumber.clearBit(number);
      fail("ArithmeticException has not been caught");
    } catch (ArithmeticException e) {
      assertEquals("Improper exception message", "Negative bit address",
          e.getMessage());
    }
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        byte aBytes[] = {-1, -128, 56, 100, -2, -76, 89, 45, 91, 3, -15, 35, 26};
        int aSign = 1;
        int number = -7;
        BigInteger aNumber = new BigInteger(aSign, aBytes);
        try {
            aNumber.clearBit(number);
            fail("ArithmeticException has not been caught");
        } catch (ArithmeticException e) {
            assertEquals("Improper exception message", "Negative bit address", e.getMessage());
        }
    }
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        // evil mutable BN
        int pos = RubyNumeric.num2int(n);
        BigInteger oldValue = this.value;
        try {
            if (oldValue.signum() >= 0) {
                this.value = oldValue.clearBit(pos);
            } else {
                this.value = oldValue.abs().clearBit(pos).negate();
            }
        } catch (ArithmeticException e) {
            throw newBNError(getRuntime(), "invalid pos");
View Full Code Here

Examples of java.math.BigInteger.clearBit()

            /* Test setBit and clearBit (and testBit) */
            if (x.signum() < 0) {
                y = BigInteger.valueOf(-1);
                for (int j=0; j<x.bitLength(); j++)
                    if (!x.testBit(j))
                        y = y.clearBit(j);
            } else {
                y = BigInteger.ZERO;
                for (int j=0; j<x.bitLength(); j++)
                    if (x.testBit(j))
                        y = y.setBit(j);
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        ks = new int[rp_bc-2];
        // find midterm orders and set ks accordingly
        BigInteger rpTmp = rp.clearBit(0);
        for (int i=ks.length-1; i>=0; i-- ) {
            ks[i] = rpTmp.getLowestSetBit();
            rpTmp = rpTmp.clearBit(ks[i]);
        }
    }

    /**
     * @com.intel.drl.spec_ref
 
View Full Code Here

Examples of java.math.BigInteger.clearBit()

        ks = new int[rp_bc-2];
        // find midterm orders and set ks accordingly
        BigInteger rpTmp = rp.clearBit(0);
        for (int i=ks.length-1; i>=0; i-- ) {
            ks[i] = rpTmp.getLowestSetBit();
            rpTmp = rpTmp.clearBit(ks[i]);
        }
    }

    /**
     * Creates a new {@code ECFieldF2m} with {@code 2^m} elements with
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.