Examples of longValue()


Examples of java.math.BigDecimal.longValue()

        if (!NumberType.isInLongLimits(result)) {
            throw Error.error(ErrorCode.X_22015);
        }

        if (isYearMonth) {
            return new IntervalMonthData(result.longValue(), this);
        }

        int nanos = (int) NumberType.scaledDecimal(result,
            DTIType.maxFractionPrecision);
View Full Code Here

Examples of java.math.BigDecimal.longValue()

        }

        int nanos = (int) NumberType.scaledDecimal(result,
            DTIType.maxFractionPrecision);

        return new IntervalSecondData(result.longValue(), nanos, this, true);
    }

    String intervalMonthToString(Object a) {

        StringBuffer sb     = new StringBuffer(8);
View Full Code Here

Examples of java.math.BigDecimal.longValue()

            if (bd.compareTo(MAX_LONG) > 0 || bd.compareTo(MIN_LONG) < 0) {
                throw Error.error(ErrorCode.X_22003);
            }

            return ValuePool.getLong(bd.longValue());
        } else if (a instanceof Double || a instanceof Float) {
            double d = ((Number) a).doubleValue();

            if (Double.isInfinite(d) || Double.isNaN(d)
                    || d >= (double) Long.MAX_VALUE + 1
View Full Code Here

Examples of java.math.BigDecimal.longValue()

            {
                return Integer.valueOf(value.intValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_LONG))
            {
                return Long.valueOf(value.longValue());
            }
            else if (getJavaTypeMapping().getJavaType().getName().equals(ClassNameConstants.JAVA_LANG_BOOLEAN))
            {
                return Boolean.valueOf(value.intValue() == 1 ? true : false);
            }
View Full Code Here

Examples of java.math.BigDecimal.longValue()

            {
                return value;
            }
            else
            {
                return Long.valueOf(value.longValue());
            }
        }
        catch (SQLException e)
        {
            throw new NucleusDataStoreException(LOCALISER_RDBMS.msg("055002","Numeric", "" + param, column, e.getMessage()),e);
View Full Code Here

Examples of java.math.BigDecimal.longValue()

            if (bd.compareTo(BIG_DECIMAL_LONG_MAX) > 0 || bd.compareTo(BIG_DECIMAL_LONG_MIN) < 0) {
                throw new TemplateModelException(
                        "Number doesn't fit into a 64 bit signed integer (long): "
                        + bd);
            } else {
                return bd.longValue();
            }
        } else if (num instanceof BigInteger) {
            BigInteger bi = (BigInteger) num;
            if (bi.compareTo(BIG_INTEGER_LONG_MAX) > 0 || bi.compareTo(BIG_INTEGER_LONG_MIN) < 0) {
                throw new TemplateModelException(
View Full Code Here

Examples of java.math.BigDecimal.longValue()

        // update current progressive in WAR02..
        if (progressive!=null) {
          // record found: it will be incremented by 10...
          pstmt2 = conn.prepareStatement(
              "update SYS20_COMPANY_PROGRESSIVES set VALUE=VALUE+"+(incrementValue.longValue()*rows)+",LAST_UPDATE_USER=?,LAST_UPDATE_DATE=?  where "+
              "COMPANY_CODE_SYS01=? and TABLE_NAME='WAR02_WAREHOUSE_MOVEMENTS' and COLUMN_NAME='PROGRESSIVE' and VALUE="+progressive
          );
          pstmt2.setString(1,username);
          pstmt2.setTimestamp(2,new java.sql.Timestamp(System.currentTimeMillis()));
          pstmt2.setString(3,companyCodeSys01);
View Full Code Here

Examples of java.math.BigDecimal.longValue()

          pstmt2.setString(13,rset.getString(11));
          pstmt2.setString(14,rset.getString(12));

          deltaQty = rset.getBigDecimal(13);
          pstmt2.setBigDecimal(15,deltaQty);
          pstmt2.setString(16,deltaQty.longValue()<0?negWarehouseMotiveWar04:posWarehouseMotiveWar04);
          pstmt2.setBigDecimal(17,rset.getBigDecimal(14)); // progressiveHIE01
          pstmt2.setTimestamp(18,new java.sql.Timestamp(System.currentTimeMillis()));
          pstmt2.setString(19,username);
          pstmt2.setString(20,note);
          pstmt2.setString(21,username);
View Full Code Here

Examples of java.math.BigInteger.longValue()

                BigInteger b = x.unscaledValue();
                int bits = b.bitLength();
                if (bits <= 63) {
                    if (scale == 0) {
                        writeByte((byte) DECIMAL_SMALL_0);
                        writeVarLong(b.longValue());
                    } else {
                        writeByte((byte) DECIMAL_SMALL);
                        writeVarInt(scale);
                        writeVarLong(b.longValue());
                    }
View Full Code Here

Examples of java.math.BigInteger.longValue()

    // assert transitivity for a constructed triple (d, b and l)
    long m = Long.MAX_VALUE - 1000;      // 9223372036854774807
    Double d = new Double(m);        // 9.2233720368547748E18, (long)d.doubleValue(): 9223372036854774784
    BigInteger b = BigInteger.valueOf(m + 1)// 9223372036854774808
    Long l = new Long(b.longValue() + 1);    // 9223372036854774809
    if (NumberUtils.compare(d, b) == -1 && NumberUtils.compare(b, l) == -1)
      assertEquals(-1, NumberUtils.compare(d, l));
    // this test is used to argue against the usage of the comparison
    // operators (<, == and >) when comparing doubles and longs
    // (for the values above the assertion fails, since d == l,
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.