BigInt in Original BB2D

Community Forums/Showcase/BigInt in Original BB2D

AD(Posted 2007) [#1]
Did anyone ever solve the big integer problem with the original Blitz Basic 2D that came on a DVD on some UK computer magazine?

BB2D could only go up to 2million, but I need it to go to at least 100 billion, and still be able to do mathematical operations on the number (ie: no faking the number, being able to do do 20% of 10 million, etc).

I remember there was talk of using the Japanese/Chinese abacus as an engine to handle big numbers, as I believe it went up to at least a trillion.

Anyway, did anyone solve the BigInt problem in the original BB2D and does anyone still have that code?

Many thanks.


GfK(Posted 2007) [#2]
Blitzbasic (like Blitzplus and Blitz3D) only supports 4-byte ints.

Why would you possibly need to go to 100 billion or beyond?

You could use one Int to store values between 0 and 1million, then another Int to store the number of millions.

eg:

int1 = 183704
int2 = 987301

true amount = 183,704,987,301.


H&K(Posted 2007) [#3]
Yes it was solved, and you can just write it quickly yourself.
Use an array/string and each chr is a number, then write the maths opperators yourself


DJWoodgate(Posted 2007) [#4]
Yes, I seem to remember someone wrote some interesting functions using blitz [] arrays to calculate PI to a large number of places.