Вопрос

I have a biginteger number, say

BigInteger a=Biginteger.valueOf(50);

Besides the following

BigInteger a=(BigInteger.ZERO).subtract(BigInteger.valueOf(50));

is there another way to get the negative value of my number? Can't seem to find a method.

Это было полезно?

Решение

You're looking for BigInteger's negate() method.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top