Exemple #1
0
 public MNumber setDouble(double aNumber) {
   if (aNumber == Double.POSITIVE_INFINITY) setPosInfinity();
   else if (aNumber == Double.NEGATIVE_INFINITY) setNegInfinity();
   else setNotInfinity();
   m_value = new BigInteger(new Integer((int) aNumber).toString());
   return this;
 }
Exemple #2
0
  public MNumber set(MNumber aNumber) {

    if (aNumber instanceof MNatural) {
      MNatural number = (MNatural) aNumber;
      if (number.isPosInfinity()) setPosInfinity();
      else if (number.isNegInfinity()) setNegInfinity();
      else setNotInfinity();
      m_value = new BigInteger(((MNatural) aNumber).m_value.toByteArray());
    } else {
      setDouble(aNumber.getDouble());
    }
    checkValue();
    return this;
  }