bignum

How to deal with big numbers in javascript [duplicate]

我的梦境 提交于 2019-11-25 23:26:05
问题 This question already has answers here : What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed] (2 answers) Closed 5 years ago . 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

How to implement big int in C++

萝らか妹 提交于 2019-11-25 23:25:29
问题 I\'d like to implement a big int class in C++ as a programming exercise—a class that can handle numbers bigger than a long int. I know that there are several open source implementations out there already, but I\'d like to write my own. I\'m trying to get a feel for what the right approach is. I understand that the general strategy is get the number as a string, and then break it up into smaller numbers (single digits for example), and place them in an array. At this point it should be

Fast bignum square computation

血红的双手。 提交于 2019-11-25 22:38:45
问题 To speed up my bignum divisons I need to speed up operation y = x^2 for bigints which are represented as dynamic arrays of unsigned DWORDs. To be clear: DWORD x[n+1] = { LSW, ......, MSW }; where n+1 is number of used DWORDs so value of number x = x[0]+x[1]<<32 + ... x[N]<<32*(n) The question is: How do I compute y = x^2 as fast as possible without precision loss? - Using C++ and with integer arithmetics (32bit with Carry) at disposal. My current approach is applying multiplication y = x*x

What is the standard solution in JavaScript for handling big numbers (BigNum)? [closed]

不羁岁月 提交于 2019-11-25 22:38:39
问题 Is there a bignum library for JavaScript or built-in that I can include like <script type=\"text/javascript\" src=\"the_bignum_library.js\"></script> ? I think my users would prefer to enter numbers in a web page and wait 7 seconds for a result, rather than download an executable and click through a bunch of \"this executable could possibly harm your computer\" warning screens to install it. I\'ve considered basing my own off of http://github.com/silentmatt/javascript-biginteger or http://www