Big Integer Calculator: 100 digits! A million digits?! | Math with JavaScript | Prime Factors | Divisors | Euler's Totient φ(n)

x = 
y = 
ans = 

This online big integer calculator is written entirely in JavaScript. It uses a set of customized functions based in part on the public-domain arbitrary precision arithmetic library BigInt.js. In most operations, the script functions create arrays to store arbitrarily large operands; the larger the number, the more memory and time it takes to process.

The calculator takes two integers x and y as input, and produces integer results. This means that even when you divide x by y, you always get an integer; the fractional part of the result is truncated. For example, the operation 14/5 will produce the integer 2, rather than the decimal 2.8. (To calculate the remainder of division, use the mod button.)

Simplest arithmetic operations support million-digit input values – and even larger if the user doesn’t mind the long wait. Primality tests (based on the Miller-Rabin algorithm) become noticeably slower when x is over a hundred digits long. Powers xy may be slow to compute for input values x containing tens of digits and 3-digit exponents y. Factorials x! become slow for input values x ≈ 10000.

See also:
• Big Integer Calculator in Windows Store (Windows 8 app)
• Big Integer Calculator: comments, suggestions, feature requests? (at

Other calculators:
• Prime factorization
• Divisors calculator
• Euler's totient function φ
• Highly composite numbers
• Binomial coefficients calculator
• Fibonacci numbers calculator
• Catalan numbers calculator

Doing Math with JavaScript. Copyright © 1999-2015,