Examples of signum()


Examples of cc.redberry.core.transformations.factor.jasfactor.edu.jas.poly.ExpVector.signum()

                if (l <= 1) {
                    return P;
                }
            } else {
                f = a.leadingExpVector();
                if (f.signum() == 0) {
                    P = new ArrayList<>();
                    P.add(a.monic());
                    return P;
                }
                if (e.equals(f)) {
View Full Code Here

Examples of com.ericsson.otp.erlang.OtpErlangLong.signum()

        new OtpErlangBinary(oos.toByteArray());
    return o;
      } else if (atomValue.equals("bigint")
           && i instanceof OtpErlangLong) {
    final OtpErlangLong l = (OtpErlangLong) i;
    final int w = l.signum() * l.bitLength();
    final OtpErlangLong x = new OtpErlangLong(l.longValue());
    final java.math.BigInteger b = l.bigIntegerValue();
    System.out.println("long: " + l + ": " + w + ": " + b.signum()
      * b.bitLength() + ": " + x + ": " + l.isLong() + ": "
      + l.isULong());
View Full Code Here

Examples of com.vividsolutions.jts.math.DD.signum()

   * @return  0 if the determinant is 0.
   */
  public static int signOfDet2x2(DD x1, DD y1, DD x2, DD y2)
  {
    DD det = x1.multiply(y2).selfSubtract(y1.multiply(x2));
    return det.signum();
  }

  /**
   * A value which is safely greater than the
   * relative round-off error in double-precision numbers
View Full Code Here

Examples of com.wesabe.api.util.money.Money.signum()

    }

    @Test
    public void shouldHaveASignOfZero() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
      assertEquals(0, zeroDollars.signum());
    }

    @Test
    public void shouldBeEqualToZeroDollars() throws Exception {
      Money zeroDollars = new Money(decimal("0.00"), USD);
View Full Code Here

Examples of com.zaranux.client.crypto.util.BigInteger.signum()

        // m2 = c ^ dQ mod q
        BigInteger m2 = c.modPow(dQ, q);
       
        // h = (m1 - m2) * qInv mod p
        BigInteger mtmp = m1.subtract(m2);
        if (mtmp.signum() < 0) {
            mtmp = mtmp.add(p);
        }
        BigInteger h = mtmp.multiply(qInv).mod(p);

        // m = m2 + q * h
 
View Full Code Here

Examples of java.math.BigDecimal.signum()

   */
  public int hashCode() {
    if(this.value != null) {
      if (this.value instanceof BigDecimal) {
        BigDecimal bd = (BigDecimal)this.value;
        int xsign = bd.signum();
            if (xsign == 0)
                return 0;
            bd = bd.stripTrailingZeros();
            return bd.hashCode();
      }
View Full Code Here

Examples of java.math.BigDecimal.signum()

        ValueDecimal dec = (ValueDecimal) v;
        if (dec.value.signum() == 0) {
            throw DbException.get(ErrorCode.DIVISION_BY_ZERO_1, getSQL());
        }
        BigDecimal bd = value.divide(dec.value, value.scale() + DIVIDE_SCALE_ADD, BigDecimal.ROUND_HALF_DOWN);
        if (bd.signum() == 0) {
            bd = BigDecimal.ZERO;
        } else if (bd.scale() > 0) {
            if (!bd.unscaledValue().testBit(0)) {
                String s = bd.toString();
                int i = s.length() - 1;
View Full Code Here

Examples of java.math.BigDecimal.signum()

        } else if (a instanceof BigDecimal) {
            BigDecimal bd = (BigDecimal) a;

            value = bd.doubleValue();

            int        signum = bd.signum();
            BigDecimal bdd    = new BigDecimal(value + signum);

            if (bdd.compareTo(bd) != signum) {
                throw Error.error(ErrorCode.X_22003);
            }
View Full Code Here

Examples of java.math.BigDecimal.signum()

        } else if (a instanceof BigDecimal) {
            BigDecimal bd = (BigDecimal) a;

            value = bd.doubleValue();

            int        signum = bd.signum();
            BigDecimal bdd    = new BigDecimal(value + signum);

            if (bdd.compareTo(bd) != signum) {
                throw Error.error(ErrorCode.X_22003);
            }
View Full Code Here

Examples of java.math.BigDecimal.signum()

                        p -= s;
                        s = 0;
                    }

                    return (precision - scale >= p - s) ? 0
                                                        : dec.signum();
                }
                default :
                    return 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.