Skip to content

How to divide? #31

@xeroxstar

Description

@xeroxstar

Cant find docs how to use this module, i need to divide a number but i am getting an error:

const BigInt = require('jsbn').BigInteger
let num = new BigInt('8888888888888888');
console.log(num.divide(2));

C:\debug\node_modules\jsbn\index.js:357
      var pm = m.abs();
                 ^

TypeError: m.abs is not a function
    at BigInteger.bnpDivRemTo [as divRemTo] (C:\debug\node_modules\jsbn\index.js:357:18)
    at BigInteger.bnDivide [as divide] (C:\debug\node_modules\jsbn\index.js:861:48)
    at Timeout.setTimeout [as _onTimeout] (C:\debug\api\subscription\subscription.service.js:20:27)
    at ontimeout (timers.js:436:11)
    at tryOnTimeout (timers.js:300:5)
    at listOnTimeout (timers.js:263:5)
    at Timer.processTimers (timers.js:223:10)

I am not sure if this is a bug or i am doing something wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions