How to deal with big numbers in javascript [duplicate]

Multi tool use
This question already has an answer here:
What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]
2 answers
I'm looking for a Mathematical solution that deals with really (long, big, huge, storms) numbers. I haven't found anything yet, But I don't wanna think that this problem hasn't be solve at this time. I'm looking for an easy Number solution, like Microsoft Excel Precision (30 decimals), or a BigInteger (Java) solution. in Javascript of course.
javascript floating-point decimal biginteger bignum
marked as duplicate by meagar♦, easwee, Sheridan, Filipe Gonçalves, Kamiel Wanrooij Mar 11 '14 at 13:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
add a comment |
This question already has an answer here:
What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]
2 answers
I'm looking for a Mathematical solution that deals with really (long, big, huge, storms) numbers. I haven't found anything yet, But I don't wanna think that this problem hasn't be solve at this time. I'm looking for an easy Number solution, like Microsoft Excel Precision (30 decimals), or a BigInteger (Java) solution. in Javascript of course.
javascript floating-point decimal biginteger bignum
marked as duplicate by meagar♦, easwee, Sheridan, Filipe Gonçalves, Kamiel Wanrooij Mar 11 '14 at 13:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20
add a comment |
This question already has an answer here:
What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]
2 answers
I'm looking for a Mathematical solution that deals with really (long, big, huge, storms) numbers. I haven't found anything yet, But I don't wanna think that this problem hasn't be solve at this time. I'm looking for an easy Number solution, like Microsoft Excel Precision (30 decimals), or a BigInteger (Java) solution. in Javascript of course.
javascript floating-point decimal biginteger bignum
This question already has an answer here:
What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]
2 answers
I'm looking for a Mathematical solution that deals with really (long, big, huge, storms) numbers. I haven't found anything yet, But I don't wanna think that this problem hasn't be solve at this time. I'm looking for an easy Number solution, like Microsoft Excel Precision (30 decimals), or a BigInteger (Java) solution. in Javascript of course.
This question already has an answer here:
What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]
2 answers
javascript floating-point decimal biginteger bignum
javascript floating-point decimal biginteger bignum
asked Nov 26 '10 at 22:03


crsuarezfcrsuarezf
55311128
55311128
marked as duplicate by meagar♦, easwee, Sheridan, Filipe Gonçalves, Kamiel Wanrooij Mar 11 '14 at 13:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
marked as duplicate by meagar♦, easwee, Sheridan, Filipe Gonçalves, Kamiel Wanrooij Mar 11 '14 at 13:08
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
1
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20
add a comment |
1
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20
1
1
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20
add a comment |
4 Answers
4
active
oldest
votes
It looks like this has been solved before:
What is the standard solution in Javascript for handling big numbers (BigNum)?
http://jsfromhell.com/classes/bignumber
http://www-cs-students.stanford.edu/~tjw/jsbn/
If you only need integers you can use BigInteger.js.
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
add a comment |
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
- Comprehensive set of functions and fast
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
- Comprehensive set of functions and pretty fast
BUT: Negative number representation is buggy!
bignumber.js (https://github.com/MikeMcl/bignumber.js)
- Pretty complete set of functions
BUT: Converting really big numbers from strings into BigNumber objects result in INFINITY
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
- JS-Implementation of Scheme arithmetic functions
BUT: No function for y= x^e mod n
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
- Functions for high precision claculations
BUT: It's said to be slow due to internal representation of numbers as strings
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
add a comment |
There's a BigInteger library for JavaScript available here:
- jsbn.js
(Note that I haven't used this myself. Try it and see what you think.)
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
add a comment |
There is also Silent Matt's library for Big Integers. It does not handle decimals.
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
It looks like this has been solved before:
What is the standard solution in Javascript for handling big numbers (BigNum)?
http://jsfromhell.com/classes/bignumber
http://www-cs-students.stanford.edu/~tjw/jsbn/
If you only need integers you can use BigInteger.js.
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
add a comment |
It looks like this has been solved before:
What is the standard solution in Javascript for handling big numbers (BigNum)?
http://jsfromhell.com/classes/bignumber
http://www-cs-students.stanford.edu/~tjw/jsbn/
If you only need integers you can use BigInteger.js.
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
add a comment |
It looks like this has been solved before:
What is the standard solution in Javascript for handling big numbers (BigNum)?
http://jsfromhell.com/classes/bignumber
http://www-cs-students.stanford.edu/~tjw/jsbn/
If you only need integers you can use BigInteger.js.
It looks like this has been solved before:
What is the standard solution in Javascript for handling big numbers (BigNum)?
http://jsfromhell.com/classes/bignumber
http://www-cs-students.stanford.edu/~tjw/jsbn/
If you only need integers you can use BigInteger.js.
edited May 23 '17 at 12:19
Community♦
11
11
answered Nov 26 '10 at 22:07
xscottxscott
2,0691217
2,0691217
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
add a comment |
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
Thanks, this was exactly what i was looking for. well, the second link is the winner.
– crsuarezf
Nov 27 '10 at 3:39
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
the second is great. thanks.
– ofir_aghai
Oct 28 '18 at 9:36
add a comment |
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
- Comprehensive set of functions and fast
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
- Comprehensive set of functions and pretty fast
BUT: Negative number representation is buggy!
bignumber.js (https://github.com/MikeMcl/bignumber.js)
- Pretty complete set of functions
BUT: Converting really big numbers from strings into BigNumber objects result in INFINITY
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
- JS-Implementation of Scheme arithmetic functions
BUT: No function for y= x^e mod n
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
- Functions for high precision claculations
BUT: It's said to be slow due to internal representation of numbers as strings
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
add a comment |
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
- Comprehensive set of functions and fast
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
- Comprehensive set of functions and pretty fast
BUT: Negative number representation is buggy!
bignumber.js (https://github.com/MikeMcl/bignumber.js)
- Pretty complete set of functions
BUT: Converting really big numbers from strings into BigNumber objects result in INFINITY
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
- JS-Implementation of Scheme arithmetic functions
BUT: No function for y= x^e mod n
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
- Functions for high precision claculations
BUT: It's said to be slow due to internal representation of numbers as strings
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
add a comment |
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
- Comprehensive set of functions and fast
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
- Comprehensive set of functions and pretty fast
BUT: Negative number representation is buggy!
bignumber.js (https://github.com/MikeMcl/bignumber.js)
- Pretty complete set of functions
BUT: Converting really big numbers from strings into BigNumber objects result in INFINITY
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
- JS-Implementation of Scheme arithmetic functions
BUT: No function for y= x^e mod n
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
- Functions for high precision claculations
BUT: It's said to be slow due to internal representation of numbers as strings
While looking for an big integer library for an ElGamal crypto implementation I tested several libraries with the following results:
I recommend this one: Tom Wu's jsbn.js (http://www-cs-students.stanford.edu/~tjw/jsbn/)
- Comprehensive set of functions and fast
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js)
- Comprehensive set of functions and pretty fast
BUT: Negative number representation is buggy!
bignumber.js (https://github.com/MikeMcl/bignumber.js)
- Pretty complete set of functions
BUT: Converting really big numbers from strings into BigNumber objects result in INFINITY
Scheme arithmetic library for JavaScript (https://github.com/jtobey/javascript-bignum)
- JS-Implementation of Scheme arithmetic functions
BUT: No function for y= x^e mod n
I haven't tested this by myself: BigNumber (http://jsfromhell.com/classes/bignumber)
- Functions for high precision claculations
BUT: It's said to be slow due to internal representation of numbers as strings
answered Jun 11 '13 at 15:01
TorbenTorben
4,23112623
4,23112623
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
add a comment |
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
Does the "BUT" for bignumber.js still hold true - is there an issue about this?
– Olga
Nov 30 '15 at 15:21
add a comment |
There's a BigInteger library for JavaScript available here:
- jsbn.js
(Note that I haven't used this myself. Try it and see what you think.)
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
add a comment |
There's a BigInteger library for JavaScript available here:
- jsbn.js
(Note that I haven't used this myself. Try it and see what you think.)
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
add a comment |
There's a BigInteger library for JavaScript available here:
- jsbn.js
(Note that I haven't used this myself. Try it and see what you think.)
There's a BigInteger library for JavaScript available here:
- jsbn.js
(Note that I haven't used this myself. Try it and see what you think.)
answered Nov 26 '10 at 22:06
LukeHLukeH
205k44305381
205k44305381
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
add a comment |
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
+1 for an answer, but wow that script needs refactoring. Completely unnecessary global symbols all over the place, just asking for collisions.
– T.J. Crowder
Nov 26 '10 at 22:18
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
@TJ I think that one's a more-or-less direct translation of the Java BigDecimal class ... it's been around forever
– Pointy
Nov 26 '10 at 22:21
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
Thanks, it would be great, if it just was a little more easy to understand and extend from.
– crsuarezf
Nov 27 '10 at 3:38
add a comment |
There is also Silent Matt's library for Big Integers. It does not handle decimals.
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
add a comment |
There is also Silent Matt's library for Big Integers. It does not handle decimals.
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
add a comment |
There is also Silent Matt's library for Big Integers. It does not handle decimals.
There is also Silent Matt's library for Big Integers. It does not handle decimals.
answered Dec 14 '10 at 21:18


Jérôme VerstryngeJérôme Verstrynge
28.1k64219389
28.1k64219389
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
add a comment |
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
Sorry, but I'was looking for one that manage specially that kind of numbers. :)
– crsuarezf
Dec 14 '10 at 21:34
add a comment |
ctlxnPx4QsQ
1
See stackoverflow.com/questions/3072307/…
– Crescent Fresh
Nov 26 '10 at 22:20