不喜欢广告? 无广告 今天

Big Integer Calculator

开发人员数学
广告 移除?
[iotools_big_integer_calculator]
广告 移除?

指导

Big Integer Calculator

Big Integer Calculator

Compute exact results for math expressions that overflow ordinary calculators. The tool runs entirely on JavaScript BigInt, so factorial(1000), 25000, fibonacci(10000), and primality checks on trillion-digit candidates return every digit correctly — no scientific notation, no silent rounding.

如何使用

  1. Type an integer expression, for example 2 ** 1000, factorial(100), 或者 gcd(1071, 462).
  2. Pick an output base (decimal, hex, binary, octal). The result updates as you type.
  3. Use Copy or Download to grab the full result — useful when the number runs to thousands of digits.
  4. Read the digit count under the result to compare growth rates of different expressions.

特征

  • Operators - +, -, *, / (integer truncation), % (mod), **^ (power), and postfix ! for factorial.
  • Built-in functions - factorial, fibonacci / fib (fast-doubling), gcd, lcm, isprime (deterministic Miller-Rabin), nextprime, abs, pow, mod, and integer sqrt.
  • Number literals – decimal, 0x hex, 0b binary, 0o octal, plus _ separators for readability such as 1_000_000.
  • Output bases – render the same value in base 10, 16, 2, or 8 without recomputing.
  • Digit counter – instantly reports how many decimal digits the answer has, even when the result spans pages.
  • Runs in your browser – nothing is sent to a server, and the parser rejects negative exponents, decimal points, and unbounded exponents that would freeze the page.

Example Inputs

  • 100! – 158-digit factorial.
  • 2 ** 1000 – the value behind 1000-bit RSA-style key sizes.
  • fibonacci(500) – the 500th Fibonacci number, 105 decimal digits.
  • nextprime(10 ** 30) – the next prime above an octillion.
  • gcd(1071, 462) – the Euclidean algorithm at work.
  • isprime(1000000000039) – a 13-digit prime confirmed in milliseconds.

常问问题

  1. Why do regular calculators give wrong results for large factorials or powers?

    JavaScript and most calculators use 64-bit floating-point numbers, which can represent integers exactly only up to 253-1 (about 9 quadrillion). Beyond that, results are silently rounded to the nearest representable float, so factorial(21), 254, and other large integers lose precision. BigInt-based calculators store digits arbitrarily, so every digit is exact.

  2. What is arbitrary-precision arithmetic and where is it used?

    Arbitrary-precision arithmetic represents integers with as many digits as memory allows, instead of a fixed register width. It is essential to RSA and elliptic-curve cryptography (keys are 2048-4096-bit integers), to financial systems that need exact decimals, to combinatorics, and to number-theory research.

  3. How does the Miller-Rabin primality test decide if a number is prime?

    Miller-Rabin picks witnesses a and checks whether a relationship that must hold for primes (derived from Fermat's little theorem) holds for the candidate n. A single random witness can be fooled, but with carefully chosen small witnesses the test becomes deterministic up to large bounds. With witnesses {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37}, the result is provably correct for every integer up to 3.317 * 1024.

  4. How big does factorial(n) get?

    Stirling's approximation gives log10(n!) ≈ n·log10(n/e) + 0.5·log10(2π·n). So 100! has about 158 digits, 1000! has 2568 digits, and 10000! has 35660 digits. A standard double-precision float overflows around 170!.

  5. Why are gcd and lcm so important in number theory?

    The greatest common divisor (gcd) and least common multiple (lcm) are the foundation for reducing fractions, solving linear Diophantine equations, the Chinese Remainder Theorem, and computing modular inverses. The Euclidean algorithm, used here, computes gcd in O(log min(a,b)) steps even for thousand-digit inputs.

想要享受无广告的体验吗? 立即无广告

安装我们的扩展

将 IO 工具添加到您最喜欢的浏览器,以便即时访问和更快地搜索

添加 Chrome 扩展程序 添加 边缘延伸 添加 Firefox 扩展 添加 Opera 扩展

记分板已到达!

记分板 是一种有趣的跟踪您游戏的方式,所有数据都存储在您的浏览器中。更多功能即将推出!

广告 移除?
广告 移除?
广告 移除?

新闻角 包含技术亮点

参与其中

帮助我们继续提供有价值的免费工具

给我买杯咖啡
广告 移除?