Package java.math

Examples of java.math.BigInteger.longValue()


            litValue = fLiteral;
        }
        else if ((iLiteral = p.parseIntegerLiteral()) != null)
        {
            litType = Long.class;
            litValue = new Long(iLiteral.longValue());
        }
        else if ((bLiteral = p.parseBooleanLiteral()) != null)
        {
            litType = Boolean.class;
            litValue = bLiteral;
View Full Code Here


            Parser p = new Parser(query.getRange(), new Imports());

            BigInteger from = p.parseIntegerLiteral();
            if (from != null)
            {
                this.fromIncl = from.longValue();
            }
            p.skipWS();
            if (p.parseChar(','))
            {
                p.skipWS();
View Full Code Here

            {
                p.skipWS();
                BigInteger to = p.parseIntegerLiteral();
                if (to != null)
                {
                    this.toExcl = to.longValue();
                }
            }
        }
    }
View Full Code Here

    // 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

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

                        if (((IntervalType) type).isDaySecondIntervalType()) {
                            return new IntervalSecondData(bi.longValue(),
                                                          currentLong,
                                                          (IntervalType) type,
                                                          true);
                        } else {
                            return IntervalMonthData.newIntervalMonth(
View Full Code Here

                                                          currentLong,
                                                          (IntervalType) type,
                                                          true);
                        } else {
                            return IntervalMonthData.newIntervalMonth(
                                bi.longValue(), (IntervalType) type);
                        }
                    }
                    default :
                        throw Error.runtimeError(ErrorCode.U_S0500,
                                                 "SetFunction");
View Full Code Here

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

                        if (((IntervalType) type).isDaySecondIntervalType()) {
                            return new IntervalSecondData(bi.longValue(),
                                                          currentLong,
                                                          (IntervalType) type,
                                                          true);
                        } else {
                            return IntervalMonthData.newIntervalMonth(
View Full Code Here

                                                          currentLong,
                                                          (IntervalType) type,
                                                          true);
                        } else {
                            return IntervalMonthData.newIntervalMonth(
                                bi.longValue(), (IntervalType) type);
                        }
                    }
                    default :
                        throw Error.runtimeError(ErrorCode.U_S0500,
                                                 "SetFunction");
View Full Code Here

                return new Integer(bi.intValue());
            }
            if(bi.compareTo(LONG_MAX) <= 0 && bi.compareTo(LONG_MIN) >= 0)
            {
                // BigInteger -> Long
                return new Long(bi.longValue());
            }
        }
        return number;
    }
}
View Full Code Here

            if (bi.compareTo(BIG_INTEGER_LONG_MAX) > 0 || bi.compareTo(BIG_INTEGER_LONG_MIN) < 0) {
                throw new TemplateModelException(
                        "Number doesn't fit into a 64 bit signed integer (long): "
                        + bi);
            } else {
                return bi.longValue();
            }
        } else if (num instanceof Long || num instanceof Integer
                || num instanceof Byte || num instanceof Short) {
            // Should add Atomic* types in 2.4...
            return num.longValue();
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.