我看到這樣的一個 構造函數
BigInteger(int signum, byte[] magnitude)
//Translates the sign-magnitude representation of a BigInteger into a BigInteger.
Translates the sign-magnitude representation of a BigInteger into a BigInteger. The sign is represented as an integer signum value: -1 for negative, 0 for zero, or 1 for positive. The magnitude is a byte array in big-endian byte-order: the most significant byte is in the zeroth element. A zero-length magnitude array is permissible, and will result in a BigInteger value of 0, whether signum is -1, 0 or 1.
Parameters:
signum - signum of the number (-1 for negative, 0 for zero, 1 for positive).
magnitude - big-endian binary representation of the magnitude of the number.
Throws:
NumberFormatException - signum is not one of the three legal values (-1, 0, and 1), or signum is 0 and magnitude contains one or more non-zero bytes.
翻譯過來就是:
第一個參數 signNum 就是 符號,
- -1 代表我們將構造出一個 負數。
- 0 就代表構造一個0 吧
- 1 就是代表我們構造一個正數
第二個參數 是個byte array。它是一個大端表示的數字的幅度;(我們的電腦一般都是小端的)
參考:
https://docs.oracle.com/javase/8/docs/api/