Examples of toBigInteger()


Examples of java.math.BigDecimal.toBigInteger()

  @GwtIncompatible("DoubleMath.roundToBigInteger(double, RoundingMode)")
  public void testRoundExactIntegralDoubleToBigInteger() {
    for (double d : INTEGRAL_DOUBLE_CANDIDATES) {
      BigDecimal expected = new BigDecimal(d).setScale(0, UNNECESSARY);
      assertEquals(expected.toBigInteger(), DoubleMath.roundToBigInteger(d, UNNECESSARY));
    }
  }

  @GwtIncompatible("DoubleMath.roundToBigInteger(double, RoundingMode)")
  public void testRoundExactFractionalDoubleToBigIntegerFails() {
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

                                        );
        }
        BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) rhs.getField(DatatypeConstants.SECONDS);
        BigInteger rhsSeconds = null;
        if ( rhsSecondsAsBigDecimal != null ) {
                rhsSeconds =  rhsSecondsAsBigDecimal.toBigInteger();
        }
        if (rhsSeconds != null && rhsSeconds.compareTo(maxintAsBigInteger) == 1) {
                throw new UnsupportedOperationException(
                        DatatypeMessageFormatter.formatMessage(null, "TooLarge",
                            new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), rhsSeconds.toString()})
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

                if (null != is) {
                    ack = PersistenceUtils.getInstance()
                        .deserialiseAcknowledgment(is);
                }
                DestinationSequence seq = new DestinationSequence(sid, acksTo,
                                                                  lm == null ? null : lm.toBigInteger(), ack);
                seqs.add(seq);                                                
            }
        } catch (SQLException ex) {
            LOG.log(Level.WARNING, new Message("SELECT_DEST_SEQ_FAILED_MSG", LOG).toString(), ex);
        }
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

          );
      }
      BigDecimal rhsSecondsAsBigDecimal = (BigDecimal) rhs.getField(DatatypeConstants.SECONDS);
      BigInteger rhsSeconds = null;
        if ( rhsSecondsAsBigDecimal != null ) {
                rhsSeconds =  rhsSecondsAsBigDecimal.toBigInteger();
        }
      if (rhsSeconds != null && rhsSeconds.compareTo(maxintAsBigInteger) == 1) {
        throw new UnsupportedOperationException(
                        DatatypeMessageFormatter.formatMessage(null, "TooLarge",
                            new Object[]{this.getClass().getName() + "#compare(Duration duration)" + DatatypeConstants.SECONDS.toString(), rhsSeconds.toString()})
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

        if (storeLargeNumbersAsStrings) {
            String str = getString(rs, column);
            return (str == null) ? null : new BigDecimal(str).toBigInteger();
        }
        BigDecimal bd = getBigDecimal(rs, column);
        return (bd == null) ? null : bd.toBigInteger();
    }

    /**
     * Convert the specified column of the SQL ResultSet to the proper
     * java type.
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

        else if (type == Boolean.class) {
            return (T) checkWasNull(stream, Boolean.valueOf(stream.readBoolean()));
        }
        else if (type == BigInteger.class) {
            BigDecimal result = stream.readBigDecimal();
            return (T) (result == null ? null : result.toBigInteger());
        }
        else if (type == BigDecimal.class) {
            return (T) stream.readBigDecimal();
        }
        else if (type == Byte.class) {
View Full Code Here

Examples of java.math.BigDecimal.toBigInteger()

            if (ctx.getDialect() == SQLDialect.SQLITE) {
                return Convert.convert(rs.getString(index), (Class<? extends T>) BigInteger.class);
            }
            else {
                BigDecimal result = rs.getBigDecimal(index);
                return (T) (result == null ? null : result.toBigInteger());
            }
        }
        else if (type == BigDecimal.class) {
            // The SQLite JDBC driver doesn't support BigDecimals
            if (ctx.getDialect() == SQLDialect.SQLITE) {
View Full Code Here

Examples of org.bouncycastle.math.ec.ECFieldElement.toBigInteger()

        ECFieldElement t = fe;
        for (int i = 0; i < fe.getFieldSize() - 1; i++)
        {
            t = t.square().add(fe);
        }
        return t.toBigInteger();
    }

    /**
     * Solves a quadratic equation <code>z<sup>2</sup> + z = beta</code>(X9.62
     * D.1.6) The other solution is <code>z + 1</code>.
View Full Code Here

Examples of org.bouncycastle.math.ec.ECFieldElement.toBigInteger()

    }

    public BigInteger[] generateSignature(byte[] message)
    {
        ECFieldElement h = hash2FieldElement(key.getParameters().getCurve(), message);
        if (h.toBigInteger().signum() == 0)
        {
            h = key.getParameters().getCurve().fromBigInteger(ONE);
        }

        BigInteger e, r, s;
View Full Code Here

Examples of org.bouncycastle.math.ec.ECFieldElement.toBigInteger()

                do
                {
                    e = generateRandomInteger(key.getParameters().getN(), random);
                    Fe = key.getParameters().getG().multiply(e).getX();
                }
                while (Fe.toBigInteger().signum() == 0);

                y = h.multiply(Fe);
                r = fieldElement2Integer(key.getParameters().getN(), y);
            }
            while (r.signum() == 0);
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.