Examples of negate()


Examples of java.math.BigDecimal.negate()

                    String direction = temp.toString().substring(4);
                    //Decimal Degrees = Degrees + minutes/60
                    BigDecimal convertedCoordinates = degrees.add(minutes.divide(sixty, new MathContext(5)));
                    //negate coordinate if it is -> South
                    if (direction.toLowerCase().equals("s")) {
                        convertedCoordinates.negate();
                    }
                    mainTable.setValueAt(convertedCoordinates, i, selectedColIndex);
                } else if (temp != null && temp.toString().length() == 7) {//latitude with seconds

                    //Uses BigDecimal in order to enabe control of precision after the .
View Full Code Here

Examples of java.math.BigDecimal.negate()

                    //Decimal Degrees = Degrees + minutes/60
                    BigDecimal convertedCoordinates = degrees.add(minutes.add(seconds), new MathContext(5));

                    //negate coordinate if it is -> South
                    if (direction.toLowerCase().equals("s")) {
                        convertedCoordinates.negate();
                    }
                    mainTable.setValueAt(convertedCoordinates, i, selectedColIndex);
                } else {
                    statusBar.setMessage("Data in selected column does not seem to be of appropriate type.");
                    return;
View Full Code Here

Examples of java.math.BigDecimal.negate()

                    //Decimal Degrees = Degrees + minutes/60
                    BigDecimal convertedCoordinates = degrees.add(minutes, new MathContext(5));

                    //negate coordinate if it is -> West
                    if (direction.toLowerCase().equals("w")) {
                        convertedCoordinates = convertedCoordinates.negate();
                    }
                    mainTable.setValueAt(convertedCoordinates, i, selectedColIndex);
                } else if (temp != null && temp.toString().length() == 8) {//Longitude with seconds
                    //Uses BigDecimal in order to enabe control of precision after the .
                    //and get precise coordinate value
View Full Code Here

Examples of java.math.BigDecimal.negate()

                    //Decimal Degrees = Degrees + minutes/60 + seconds/3600
                    BigDecimal convertedCoordinates = degrees.add(minutes.add(seconds), new MathContext(5));

                    //negate coordinate if it is -> West
                    if (direction.toLowerCase().equals("w")) {
                        convertedCoordinates = convertedCoordinates.negate();
                    }
                    mainTable.setValueAt(convertedCoordinates, i, selectedColIndex);
                } else {
                    statusBar.setMessage("Data in selected column does not seem to be of appropriate type.");
                    return;
View Full Code Here

Examples of java.math.BigInteger.negate()

            // And then, let's just multiply by 10, add a new digit
            I = I.multiply(BigInteger.valueOf(10)).add(BigInteger.valueOf(rnd.nextInt() & 0xF));

            // Plus switch sign every now and then
            if ((i % 3) == 0) {
                I = I.negate();
            }
        }
    }

    /**
 
View Full Code Here

Examples of java.math.BigInteger.negate()

        {
            BigInteger bi = new BigInteger(lexical);
           
            // But we may over/underflow, let's check:
            if (neg) {
                bi = bi.negate();
                if (bi.compareTo(BD_MIN_LONG) >= 0) {
                    return bi.longValue();
                }
            } else {
                if (bi.compareTo(BD_MAX_LONG) <= 0) {
View Full Code Here

Examples of java.math.BigInteger.negate()

          digits[i] = input.readSignedByte();
        }

        BigInteger value = new BigInteger(digits);
        if (!positive) {
            value = value.negate();
        }

        RubyNumeric result = bignorm(input.getRuntime(), value);
        input.registerLinkTarget(result);
        return result;
View Full Code Here

Examples of java.math.BigInteger.negate()

            return;
        }
        final int signum = v.signum();
        BigInteger val = v;
        if (signum < 0) {
            val = val.negate();
        }
        final byte[] magnitude = val.toByteArray();
        final int n = magnitude.length;
        // Reverse the array to make it little endian.
        for (int i = 0, j = n; i < j--; i++) {
View Full Code Here

Examples of java.math.BigInteger.negate()

        BigInteger toBigInteger() {
            BigInteger bint = new BigInteger(this.literal, this.radix);
            if (this.positive) {
                return bint;
            } else {
                return bint.negate();
            }
        }
    }
}
View Full Code Here

Examples of java.math.BigInteger.negate()

            BigInteger unscaled = newValue.unscaledValue();
            if (unscaled.signum() >= 0) {
                this.plus = true;
            } else {
                this.plus = false;
                unscaled = unscaled.negate();
            }
            setUnsigned(unscaled);
        }

        void set(boolean newPlus, int newScale, byte[] data, int offset, int length) {
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.