Package java.math

Examples of java.math.BigInteger.negate()


    public BigInteger toInteger(){
        BigDecimal num = number.get();
        boolean negatif = num.signum()==-1;
        BigDecimal n=num.abs();
        BigInteger n2 = BigDecimalMath.round(n).toBigInteger();
        return negatif ? n2.negate(): n2;
    }
   
    /**
     * retourne un Node:Integer qui correspond à la partie tronquée (avec arrondi "round") du Decimal courant.
     *
 
View Full Code Here


      is_neg = false;
    }
    byte[] ba = new byte[len];
    System.arraycopy(buf, offset, ba, 0, len);
    BigInteger a = new BigInteger(ba);
    if (is_neg) a = a.negate();
    return(a);
  }
   
  public static Object bytesToInteger(byte[] buf, int offset, int len) {
   
View Full Code Here

          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

        } else {
            z = new BigInteger(new String(result, 0, resultIndex), base);
        }

        if(!sign) {
            z = z.negate();
        }

        if(badcheck) {
            if(_str.getBegin() + 1 < str && data[str-1] == '_') {
                invalidString("Integer");
View Full Code Here

      is_neg = false;
    }
    byte[] ba = new byte[len];
    System.arraycopy(buf, offset, ba, 0, len);
    BigInteger a = new BigInteger(ba);
    if (is_neg) a = a.negate();
    return(a);
  }
   
  public static Object bytesToInteger(byte[] buf, int offset, int len) {
   
View Full Code Here

      is_neg = false;
    }
    byte[] ba = new byte[len];
    System.arraycopy(buf, offset, ba, 0, len);
    BigInteger a = new BigInteger(ba);
    if (is_neg) a = a.negate();
    return(a);
  }
   
  public static Object bytesToInteger(byte[] buf, int offset, int len) {
   
View Full Code Here

      index++;
      radix = 8;
    }

    BigInteger result = new BigInteger(value.substring(index), radix);
    return (negative ? result.negate() : result);
  }

}
View Full Code Here

      index++;
      radix = 8;
    }

    BigInteger result = new BigInteger(value.substring(index), radix);
    return (negative ? result.negate() : result);
  }

}
View Full Code Here

      index++;
      radix = 8;
    }

    BigInteger result = new BigInteger(value.substring(index), radix);
    return (negative ? result.negate() : result);
  }

}
View Full Code Here

        BigInteger x3 = m.pow(2)
            .subtract(new BigInteger("2").multiply(this.x))
            .mod(curve.p);
        BigInteger y3 = this.y.add(m.multiply(x3.subtract(this.x)))
            .mod(curve.p);
        return new Element(this.curve, x3, y3.negate());
      } else if (this.x.equals(another.x) && !this.y.equals(another.y)) {
        return EllipticCurve.ZERO;
      } else {
        // m = (y2-y1)(x2-x1)^(-1)
        BigInteger m = another.y
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.