Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

BigInt 基本属性示例

以下为初始化 BigInt 对象的,并查询对象的基本属性的示例:

import std.math.numeric.*

main() {
    let int = BigInt.parse("-123456")
    println("BigInt: ${int}")
    println("BigInt sign: ${int.sign}")
    println("BigInt bitLen: ${int.bitLen}")
    return 0
}

运行结果:

BigInt: -123456
BigInt sign: -1
BigInt bitLen: 18