Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
64 Bit's in QB?
#31
■ CURRENCY An 8-byte signed integer variable with up to
four digits to the right of the decimal point;
15 digits to the left of the decimal point.

Jonathan Simpson
onathan Simpson
Reply
#32
Quote:..............

Yes..

I think I figured out how to extend it:

Just change "< 4" to "< 4999" and "- 5" to "- 5000".

It's even faster then: 5 seconds.
Very good Aga, but your algorithm is specific Smile So you haven't beaten BigInt with this yet! Wink BigInt can calculate everything you want (almost) and yours can only calculate 2 ^ 32000! Wink Try 3000! or pi... Wink
Reply
#33
Quote:I mean a 64bit Integer type, I think it's called a dword (double word), no decimals.

16 bit= word
32 bit = double word
64 bit = quad word
y smiley is 24 bit.
[Image: anya2.jpg]

Genso's Junkyard:
http://rel.betterwebber.com/
Reply
#34
It's quite possible to do 2^100000. Big Grin

I know how to make it do a^n instead of just 2^n, but..

The thing with 2^n is that the maximum carry bit from the number itself is always one:

1>0, 2
2>0, 4
4>0, 8
8>1, 6
6>1, 2

3>0, 6
7>1, 4
9>1, 8

Unfortunately it isn't always like that:
power = 23
1>2, 3
3>6, 9
9>20, 7
7>16, 1

2>4, 6
4>9, 2
6>13, 8
8>18, 4

--------------------

My algorithm would still be faster than yours, for two reasons:

1) The number representations would be stored in integers. (LONGs are slower..)
2) The carry value and the same-digit result can be stored in a length-ten array, eliminating thousands or millions of repetitive multiplications. =)
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#35
I was talking about real compatibility with anything. I mean, if you just follow your algo and implement all cases it which it doesn't work in another way, you're not doing well. I just want one algo for powers, one algo for multiplying, etc. So that you can do everything with it without great differences.
Reply
#36
I'd have to show you my brain for that.
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#37
Quote:I'd have to show you my brain for that.

:rotfl:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)