Examples of signum()


Examples of java.math.BigInteger.signum()

                        result.set(Calendar.ERA, defaultYear < 0 ? GregorianCalendar.BC : GregorianCalendar.AD);
                        result.set(Calendar.YEAR, Math.abs(defaultYear));
                    }
                    else {
                        final BigInteger defaultEonAndYear = defaults.getEonAndYear();
                        result.set(Calendar.ERA, defaultEonAndYear.signum() == -1 ? GregorianCalendar.BC : GregorianCalendar.AD);
                        result.set(Calendar.YEAR, defaultEonAndYear.abs().intValue());
                    }
                }
            }
        }
View Full Code Here

Examples of java.math.BigInteger.signum()

    }

    public BigIntegerToken getRandomToken()
    {
        BigInteger token = FBUtilities.hashToBigInteger(GuidGenerator.guidAsBytes());
        if ( token.signum() == -1 )
            token = token.multiply(BigInteger.valueOf(-1L));
        return new BigIntegerToken(token);
    }

    private final Token.TokenFactory<BigInteger> tokenFactory = new Token.TokenFactory<BigInteger>() {
View Full Code Here

Examples of java.math.BigInteger.signum()

    byte resBytes[] = new byte[rBytes.length];
    resBytes = result.toByteArray();
    for(int i = 0; i < resBytes.length; i++) {
      assertTrue(resBytes[i] == rBytes[i]);
    }
    assertEquals("incorrect sign", 1, result.signum());
  }
 
  /**
   * modPow: negative exponent
   */
 
View Full Code Here

Examples of java.math.BigInteger.signum()

    byte resBytes[] = new byte[rBytes.length];
    resBytes = result.toByteArray();
    for(int i = 0; i < resBytes.length; i++) {
      assertTrue(resBytes[i] == rBytes[i]);
    }
    assertEquals("incorrect sign", 1, result.signum());
  }

  /**
   * modInverse: non-positive modulus
   */
 
View Full Code Here

Examples of java.math.BigInteger.signum()

    byte resBytes[] = new byte[rBytes.length];
    resBytes = result.toByteArray();
    for(int i = 0; i < resBytes.length; i++) {
      assertTrue(resBytes[i] == rBytes[i]);
    }
    assertEquals("incorrect sign", 1, result.signum());
  }

  /**
   * modInverse: positive number (another case: a < 0)
   */
 
View Full Code Here

Examples of java.math.BigInteger.signum()

    byte resBytes[] = new byte[rBytes.length];
    resBytes = result.toByteArray();
    for(int i = 0; i < resBytes.length; i++) {
      assertTrue(resBytes[i] == rBytes[i]);
    }
    assertEquals("incorrect sign", 1, result.signum());
  }

  /**
   * modInverse: negative number
   */
 
View Full Code Here

Examples of mikera.arrayz.INDArray.signum()

  }
 
  @Override
  public INDArray signumCopy() {
    INDArray r=clone();
    r.signum();
    return r;
  }
 
  @Override
  public Iterator<T> iterator() {
View Full Code Here

Examples of net.sf.saxon.value.NumericValue.signum()

            lend = ((Int64Value)end).longValue();
        } else {
            // We need to be careful to handle cases such as plus/minus infinity and NaN
            if (end.isNaN()) {
                return "";
            } else if (end.signum() <= 0) {
                return "";
            } else if (end.compareTo(slength) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                lend = slength+1;
View Full Code Here

Examples of org.apache.hadoop.hive.common.type.HiveDecimal.signum()

      if (bytes == src.length) {
        // No padding needed.
        return new BytesWritable(src);
      }
      byte[] tgt = new byte[bytes];
      if ( hd.signum() == -1) {
        // For negative number, initializing bits to 1
        for (int i = 0; i < bytes; i++) {
          tgt[i] |= 0xFF;
        }
      }
View Full Code Here

Examples of org.pdf4j.saxon.value.NumericValue.signum()

        } else {
            NumericValue rstart = start.round();
            // We need to be careful to handle cases such as plus/minus infinity
            if (rstart.isNaN()) {
                return "";
            } else if (rstart.signum() <= 0) {
                return s;
            } else if (rstart.compareTo(slength) > 0) {
                // this works even where the string contains surrogate pairs,
                // because the Java length is always >= the XPath length
                return "";
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.