Quote:Neo Wrote:Try for yourself. At my place, it can calculate 2 ^ 32000 in a number of seconds...

I have tried it :wink:

Code:

`n1$ = "2"`

n2$ = "1000"

t! = TIMER

PRINT SI.Power(n1$, n2$)

PRINT TIMER - t!

Time taken 2.0seconds

I did try 2^32000, I gave up after letting it run for about 2min

What kind of computer do you have?, I'm running this on a 850mhz 128mb ram.

Hehe

I have a AMD Athlon XP 2400+ with 512 MB RAM (2.0 GHz). I can run it again, to see how long it takes on my comp.

Anyway, about BIGINT, short calculations like 31130581380334 * 4018810580510 are very fast, while long calculations like 2 ^ 32000 can take a few mins on slower comps. It is with BigInt as well, in combination with NeoLib, that I was able to calculate a few prime numbers in the far region of numbers (like 2 ^ 32000). Using NeoLib only I could define all prime numbers up to 10,000,000 in 170 seconds.

Oracle tried to upgrade BIGINT to something like BIGDEC(IMAL) with support for negatives and decimals as well. However, he encountered a lot of problems and bugs.

Perhaps I'll try to continue his work some day.

Anyway, I hope you like BIGINT and that it can suit you on some calculations you need.

Quote:ah! i thought so. There are too many complexities if you look at it. Some properties will speed up the operation while others will slow it down .

Indeed. With strings however this can be done fast as well, since every character is 8 bit. Just do ASC(Number$) - ASC("0") to calculate the number representative of a string number, when you don't want to use VAL(Number$) that is.

Another advantage of using 8 bit is that you don't need to calculate advanced positions in the number, a problem you do have when using nibbles to represent a number. The question you e.g. might run into then are 'Which byte should I store a number to?' and 'Which part of the byte should the number be in? Hi or Lo?'. To avoid extra work I used strings.

But... in theory, it

can be done more efficiently with nibbels. Moreover, the maximum values of a BIGINT increases then to 65536 numbers. But don't expect 2 ^ 64000 to take a few seconds when using nibbles!