Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
My code (
arr
is array of nativeBigInt
):Output:
As you see,
BN.toFixed
is able to get accurate representation.Why not print BigInts as strings, then? Is it difficult to convert bigint to string and display it?
Not easy (because Bignumber.js doesnt't display well very big numbers) but I'll try to explain that your result is wrong.
with JS
They seem pretty close.
with Python or another language with native big integers:
I expect my answer is clear enough, if not please tell.
I looked at your code and trie it and unfortunately I am sorry to think that you are not in the right way.
Edit: It seems you now Python so you can try it on this kata and have no problem with big integeers.