import console;
import godking.bigNum
var bn1 = godking.bigNum("-2345567465131561651313223532.452354235")
console.dump("加法计算:",bn1.add(123456).getString())
var bn2 = godking.bigNum("111111111111111111111111111111111111111")
console.dump("减法计算:",bn2.sub("9898956623234564365436433123456.32323").getString())
console.dump("乘法计算:",bn1.mul(bn2).getString())
console.dump("除法计算:",bn1.div(bn2).getString())
console.dump("当前大数数量:",godking.bigNum.getCount())
godking.bigNum.clear()
console.dump("大数已清空,当前大数数量:",godking.bigNum.getCount())
console.pause(true);
其他更多用法:
import console;
import godking.bigNum
var bn1 = godking.bigNum("-234523532.4235")
console.dump("幂负计算:",tostring(bn1),tostring(-bn1),tostring(bn1**2))
var bn2 = godking.bigNum("11111111111111")
console.dump("减法计算:",(bn2-"3456.32323").toString(),(bn2-3456.32323).toString())
console.dump("乘法计算:",(bn1*bn2).toString())
console.dump("求余计算:",tostring(bn1%bn2));
console.pause(true);