# math.bignum 库模块帮助文档

<details>  <summary>说明</summary>  <p>
此扩展库基于开源项目 tiny-bignum-c 
https://github.com/kokke/tiny-bignum-c
</p></details>

## math 成员列表 <a id="math" href="#math">&#x23;</a>

### math.bignum() <a id="math.bignum" href="#math.bignum">&#x23;</a>
创建大数对象  
参数可以使用 10 进制或 16 进制的字符串指定数值,16进制必须有0x前缀,  
也可以是普通整数,或者 math.size64 函数创建的长整数,  
传入math.bignum对象则复制为新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

## math.bignum 成员列表 <a id="math.bignum" href="#math.bignum">&#x23;</a>

大数对象，仅支持正整数，不支持负数或小数。  
大数对象可以使用 tostring 函数转换为普通字符串  
并可以在 tostring 的第二个参数中指定显示进制，默认输出 10 进制数。

### math.bignum.is() <a id="math.bignum.is" href="#math.bignum.is">&#x23;</a>
参数 @1 是否 math.bignum 对象。

## mathbignumObject 成员列表 <a id="mathbignumObject" href="#mathbignumObject">&#x23;</a>

### mathbignumObject.add() <a id="mathbignumObject.add" href="#mathbignumObject.add">&#x23;</a>
加运算,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.and() <a id="mathbignumObject.and" href="#mathbignumObject.and">&#x23;</a>
位与,  
参数是普通整数  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.dec() <a id="mathbignumObject.dec" href="#mathbignumObject.dec">&#x23;</a>
自减，  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.div() <a id="mathbignumObject.div" href="#mathbignumObject.div">&#x23;</a>
除运算,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.fromString() <a id="mathbignumObject.fromString" href="#mathbignumObject.fromString">&#x23;</a>
自16进制字符串获取数值更新并返回自身

### mathbignumObject.inc() <a id="mathbignumObject.inc" href="#mathbignumObject.inc">&#x23;</a>
自增,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.isZero() <a id="mathbignumObject.isZero" href="#mathbignumObject.isZero">&#x23;</a>
数值是否为0

### mathbignumObject.isqrt() <a id="mathbignumObject.isqrt" href="#mathbignumObject.isqrt">&#x23;</a>
整数平方根,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.lshift() <a id="mathbignumObject.lshift" href="#mathbignumObject.lshift">&#x23;</a>
位左移,  
参数是普通整数  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.mod() <a id="mathbignumObject.mod" href="#mathbignumObject.mod">&#x23;</a>
模运算,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.mul() <a id="mathbignumObject.mul" href="#mathbignumObject.mul">&#x23;</a>
乘运算,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.or() <a id="mathbignumObject.or" href="#mathbignumObject.or">&#x23;</a>
位或,  
参数是普通整数  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.pow() <a id="mathbignumObject.pow" href="#mathbignumObject.pow">&#x23;</a>
乘方，  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.random() <a id="mathbignumObject.random" href="#mathbignumObject.random">&#x23;</a>
生成指定长度的随机数值更新并返回自身

### mathbignumObject.rshift() <a id="mathbignumObject.rshift" href="#mathbignumObject.rshift">&#x23;</a>
位右移,  
参数是普通整数  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.size64() <a id="mathbignumObject.size64" href="#mathbignumObject.size64">&#x23;</a>
返回size64对象

### mathbignumObject.sub() <a id="mathbignumObject.sub" href="#mathbignumObject.sub">&#x23;</a>
减运算,  
参数可以是普通整数,也可以是大数对象  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)

### mathbignumObject.xor() <a id="mathbignumObject.xor" href="#mathbignumObject.xor">&#x23;</a>
位异或,  
参数是普通整数  
返回新的大数对象

[返回对象:mathbignumObject](#mathbignumObject)
