Skip to content

big number calculation #2377

Answered by SwapOperator
SwapOperator asked this question in Q&A
Discussion options

You must be logged in to vote

ok that was a bit difficult but I got the success:

import { create, all } from 'mathjs'

// create a mathjs instance with configuration
const config = {
  number: 'BigNumber'
}
const math = create(all, config)
let x = math.bignumber(6277101735386680764176071790128604881410404459395608870912);
let string1 = String(x.toString() +" >> 16 & 65535");
console.log("string1 ", string1)
console.log("result", math.evaluate(string1))

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
3 replies
@SwapOperator
Comment options

@SwapOperator
Comment options

@SwapOperator
Comment options

Comment options

You must be logged in to vote
3 replies
@josdejong
Comment options

@SwapOperator
Comment options

@josdejong
Comment options

Answer selected by SwapOperator
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@SwapOperator
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants