Package java.math

Examples of java.math.BigInteger.signum()


        result.setGregorianChange(PURE_GREGORIAN_CHANGE);

        // if year( and eon) are undefined, leave default Calendar values
        BigInteger year = getEonAndYear();
        if (year != null) {
            result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
            result.set(Calendar.YEAR, year.abs().intValue());
        } else {
            // use default if set
            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
            if (defaultYear != null) {
View Full Code Here


            result.set(Calendar.YEAR, year.abs().intValue());
        } else {
            // use default if set
            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
            if (defaultYear != null) {
                result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                result.set(Calendar.YEAR, defaultYear.abs().intValue());
            }
        }

        // only set month if it is set
View Full Code Here

        result.setGregorianChange(PURE_GREGORIAN_CHANGE);

        // if year( and eon) are undefined, leave default Calendar values
        BigInteger year = getEonAndYear();
        if (year != null) {
            result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
            result.set(Calendar.YEAR, year.abs().intValue());
        }

        // only set month if it is set
        if (month != DatatypeConstants.FIELD_UNDEFINED) {
View Full Code Here

        result.setGregorianChange(PURE_GREGORIAN_CHANGE);

        // if year( and eon) are undefined, leave default Calendar values
        BigInteger year = getEonAndYear();
        if (year != null) {
            result.set(Calendar.ERA, year.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
            result.set(Calendar.YEAR, year.abs().intValue());
        } else {
            // use default if set
            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
            if (defaultYear != null) {
View Full Code Here

            result.set(Calendar.YEAR, year.abs().intValue());
        } else {
            // use default if set
            BigInteger defaultYear = (defaults != null) ? defaults.getEonAndYear() : null;
            if (defaultYear != null) {
                result.set(Calendar.ERA, defaultYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                result.set(Calendar.YEAR, defaultYear.abs().intValue());
            }
        }

        // only set month if it is set
View Full Code Here

     * @throws Exception
     */
    public Node external_mul(Node startAt) throws Exception {
        startAt.isGoodArgsLength(false, 2);
        BigInteger r = number.get();
        if (r.signum() == 0) {
            // cas ou la variable statique est déjà zéro.
            return Node.createExternal(new External_Integer(BigInteger.ZERO));
        }
        int i = 1;
        int asize = startAt.size();
View Full Code Here

            // cas ou la variable statique est déjà zéro.
            return Node.createExternal(new External_Integer(BigInteger.ZERO));
        }
        int i = 1;
        int asize = startAt.size();
        while (i < asize && r.signum() != 0)
            r = r.multiply(_getArg_lazy_(startAt, i++));
        //System.out.println("ml:"+r.toString());
        // signum() retourne 0 si r vaut 0. Cette méthode est plus rapide que compareTo()...
        return Node.createExternal(new External_Integer(r));
    }
View Full Code Here

        }
        BigInteger v = BigInteger.ONE;
        int ki = 1;
        while (ki < startAt.size()) {
            v = v.multiply(_getArg_lazy_(startAt, ki++));
            if (v.signum() == 0)
                ki = startAt.size();
        }
        BigInteger old_r;
        BigInteger r;
        do {
View Full Code Here

        }
        BigInteger v = BigInteger.ONE;
        int ki = 1;
        while (ki < startAt.size()) {
            v = v.multiply(_getArg_lazy_(startAt, ki++));
            if (v.signum() == 0)
                ki = startAt.size();
        }

        BigInteger old_r;
        BigInteger r;
View Full Code Here

    public Node external_and(Node startAt) throws Exception {
        startAt.isGoodArgsLength(false, 2);
        BigInteger r = number.get();
        int i = 1;
        int asize = startAt.size();
        while (i < asize && r.signum() != 0)
            r = r.and(_getArg_lazy_(startAt, i++));
        return Node.createExternal(new External_Integer(r));
    }

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