Standard calculators and computers represent numbers using 64-bit floating-point arithmetic, which can only guarantee exact results for integers up to 9,007,199,254,740,992 (2 to the power of 53). Beyond that threshold, integers are rounded to the nearest representable value and arithmetic produces silently incorrect results. This is rarely a problem in everyday calculations, but it matters when you are working with cryptographic key lengths, factorials, combinatorial counts, astronomical distances in metres, or any calculation where the numbers involved run to 20 or more digits. This calculator implements addition, subtraction and multiplication using string arithmetic: the same column-by-column algorithms you learned at primary school, applied digit by digit so that the result is always exact regardless of the size of the numbers. Enter any two positive integers of any length, choose the operation and the exact result appears instantly. The result also shows the number of digits so you can appreciate the scale. The default example multiplies 999,999,999 (nine nines) by 999, which tests carry propagation across nine digits and gives a 12-digit result. This is within JavaScript's safe integer range, but the string implementation handles the same calculation correctly for numbers a hundred digits long.
String arithmetic: exact for integers of any size. No floating-point rounding errors.
Addition: digits are aligned from the right, added column by column with carry tracked from the previous column. Subtraction: determines which number is larger, subtracts smaller from larger digit by digit with borrow, and applies a negative sign if necessary. Multiplication: implements the grade-school algorithm using an array of intermediate sums indexed by position; each digit of the first number multiplies each digit of the second, the products are added at the correct place-value offset with carry propagation. The result is trimmed of leading zeros and formatted.
999,999,999 times 999. Multiplying digit by digit from the ones: 9 times 999,999,999 = 8,999,999,991; 9 times 999,999,999 shifted one place = 89,999,999,910; 9 times 999,999,999 shifted two places = 899,999,999,100. Adding: 8,999,999,991 + 89,999,999,910 + 899,999,999,100 = 998,999,999,001 (12 digits). You can also verify this as 999,999,999 x (1000 - 1) = 999,999,999,000 - 999,999,999 = 998,999,999,001. These match the defaults pre-filled above.
If you've found a bug, or would like to contact us, or learn more about James Graham and Calculate.co.nz.
Calculate.co.nz is partnered with Interest.co.nz for New Zealand's highest quality calculators and financial analysis.
All calculators and tools are provided for educational and indicative purposes only and do not constitute financial advice.
Calculate.co.nz is proudly part of the Realtor.co.nz group, New Zealand's leading property transaction literacy platform, helping Kiwis understand the home buying and selling process from start to finish. Whether you're a first home buyer navigating your first property purchase, an investor evaluating your next acquisition, or a homeowner planning to sell, Realtor.co.nz provides clear, independent, and trustworthy guidance on every step of the New Zealand property transaction journey.
Calculate.co.nz is also partnered with Health Based Building and Premium Homes to promote informed choices that lead to better long-term outcomes for Kiwi households.
Calculate.co.nz is hosted in Auckland via SiteHost new Zealand.
All content on this website, including calculators, tools, source code, and design, is protected under the Copyright Act 1994 (New Zealand). No part of this site may be reproduced, copied, distributed, stored, or used in any form without prior written permission from the owner.
About & trust: Why Calculate is NZ's most comprehensive · By the Numbers · How we compare · Editorial standards · How we keep data current · NZ finance glossary · Research & data · Financial literacy NZ · About · Privacy policy · Terms of use
Reviewed and maintained. Last reviewed 2026-06-25 and checked on a twice-monthly cycle against IRD, RBNZ and Stats NZ. How we keep data current.
© 2026 Calculate.co.nz. All rights reserved. Building free NZ calculators since 2011.