Skip to content

Add BigInteger library and test

Tony Butler requested to merge tony/kado:addBigInteger into master

BigInt support extended with similar functionality to regular Number (fills deficiencies of actual BigInt)

Should remain as compatible with builtin BigInt as possible, for when they add .pow() or .toJSON() or etc to the builtin.

Usage is like:

const BigInt = require('kado/lib/BigInteger')
const thisIsABigInteger = BigInt(2)  // just like normal
const val = thisIsABigInteger.pow(128) // just like with Numbers

actual arithmetic does not yet work since these show up as an Object. Use .value property to obtain real BigInt content for now.

Merge request reports