User Tools

Site Tools


Handling very large numbers without using scientific notation

BB4W, like most programming languages, can handle very large numbers - but only in floating-point notation. This is fine for normal usage, but what if you want to investigate the digits of such a number? For instance, you may be looking for patterns in the digits such as a sequence or groupings of similar digits (there are still folk out there looking for patterns in pi, out at the millionth decimal place!).

The program below can multiply very large numbers together and show the exact answer with every digit present. I hope no-one is offended by the copyright notice in there. You're free to use the code without obligation, but please acknowledge me if you use it in released work. I've had the experience of having code stolen, slightly altered, and then being claimed as the work of the person doing the alteration. Anyway, here it is:

string_multiplication_2.bbcString Multiplication

I hope this is useful to someone out there.

Edit by Richard Russell, December 2013

See also the MAPM (My Arbitrary Precision Math) and HIME (Huge Integer Math and Encryption) libraries, both of which support calculations using arbitrary precision integer arithmetic:

HIMELIB is here

This website uses cookies for visitor traffic analysis. By using the website, you agree with storing the cookies on your computer.More information
handling_20very_20large_20numbers_20without_20using_20scientific_20notation.txt · Last modified: 2018/03/31 14:19 (external edit)