Package java.math

Examples of java.math.BigInteger.intValue()


    {
        // <oidString>
        oid = ((ASN1ObjectIdentifier)seq.getObjectAt(0));

        BigInteger bigN = ((ASN1Integer)seq.getObjectAt(1)).getValue();
        n = bigN.intValue();

        BigInteger bigK = ((ASN1Integer)seq.getObjectAt(2)).getValue();
        k = bigK.intValue();

        encField = ((ASN1OctetString)seq.getObjectAt(3)).getOctets();
View Full Code Here


        BigInteger bigN = ((ASN1Integer)seq.getObjectAt(1)).getValue();
        n = bigN.intValue();

        BigInteger bigK = ((ASN1Integer)seq.getObjectAt(2)).getValue();
        k = bigK.intValue();

        encField = ((ASN1OctetString)seq.getObjectAt(3)).getOctets();

        encGp = ((ASN1OctetString)seq.getObjectAt(4)).getOctets();
View Full Code Here

      harness.debug(e);
    }
    harness.check(b1.equals(b2));
    harness.check(b1.byteValue() == b2.byteValue());
    harness.check(b1.shortValue() == b2.shortValue());
    harness.check(b1.intValue() == b2.intValue());
    harness.check(b1.longValue() == b2.longValue())// see bug parade 4823171
    harness.check(b1.floatValue() == b2.floatValue());
    harness.check(b1.doubleValue() == b2.doubleValue());
  }
 
View Full Code Here

        bi = new BigInteger(25, 80, prng);
        harness.check(bi.bitLength(), 25, "Constructed BigInteger MUST be 25-bit long");

        bi = new BigInteger(2, 80, prng);
        harness.check(bi.bitLength(), 2, "Constructed BigInteger MUST be 2-bit long");
        int val = bi.intValue();
        harness.check(val == 2 || val == 3, "Constructed BigInteger MUST be 2 or 3");
      }
    catch (Exception x)
      {
        harness.verbose(x.getMessage());
View Full Code Here

        else {
            // This whole thing can be trivially rewritten after bugs
            // in modPow are fixed by SUN

            BigInteger z = coerce(modulo);
            int zi = z.intValue();
            // Clear up some special cases right away
            if (zi == 0)
                throw Py.ValueError("pow(x, y, z) with z == 0");
            if (zi == 1 || zi == -1)
                return new PyLong(0);
View Full Code Here

                    if (bd.compareTo(BigDecimal.ZERO)<0)
                        bi=bi.subtract(BigInteger.ONE);
                }
                int biBitCount=bi.bitCount();
                if (biBitCount<=32)
                    return bi.intValue();
                else if (biBitCount<=64)
                    return bi.longValue();
                else
                    return bi;
            }
View Full Code Here

                    if (numerator.compareTo(BigDecimal.ZERO)<0)
                        quotient=quotient.subtract(BigInteger.ONE);
                }
                int quotientBitCount=quotient.bitCount();
                if (quotientBitCount<=32)
                    return quotient.intValue();
                else if (quotientBitCount<=64)
                    return quotient.longValue();
                else
                    return quotient;
            }
View Full Code Here

        case 2: {
                BigInteger leftover=BigInteger.valueOf(argument).subtract(toBigInteger(upperBoundInclusive,typeUpperBound)).add(toBigInteger(lowerBoundInclusive,typeLowerBound)).subtract(BigInteger.ONE);
                if (leftover.compareTo(BigInteger.ZERO)<=0)
                    return 0;
                else
                    return leftover.intValue();
            }
        default:
            throw new IllegalArgumentException();
        }
    }
View Full Code Here

    bp = bp.stepInto(); // Step into the set of signerinfos
    bp = bp.stepInto(); // Step into the signerinfo sequence

    // make sure the version is 1
    BigInteger signerInfoVersion = bp.getIntValue();
    if (signerInfoVersion.intValue() != 1) {
      throw new CertificateException(JarVerifierMessages.PKCS7_SignerInfo_Version_Not_Supported);
    }

    // PKCS7: version CMSVersion
    bp.stepOver(); // Skip the version
View Full Code Here

        if (w.bitLength() > 31) {
            throw new ArithmeticException
                ("overflow: numerator too large after multiply");
        }
        return new Fraction
            (w.intValue(),
             mulPosAndCheck(denominator/d1, fraction.denominator/d2));
    }

    /**
     * <p>Multiplies the value of this fraction by another, returning 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.