Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
64 Bit's in QB?
#21
Correct me if I'm wrong but...isn't a DOUBLE 64 bits?
I'd knock on wood, but my desk is particle board.
Reply
#22
In VB...a DECIMAL is 64 bits, right?
f only life let you press CTRL-Z.
--------------------------------------
Freebasic is like QB, except it doesn't suck.
Reply
#23
There is no DECIMAL type in VB.
I'd knock on wood, but my desk is particle board.
Reply
#24
Yup double precision is 8bytes or 64Bits =P.
Reply
#25
2^32000 in 12 seconds. P2 400mhz. Extrapolation from digit-by-digit multiplication with strings. (a 4-bit array is the minimum for this computation)

Code:
CLS
DIM a%(0 TO 10000) 'should be as large as # of digits base 10 to store answer.
t1# = TIMER

a%(0) = 1
k% = 0
FOR i% = 0 TO 31999 '2 ^ 32000
j% = 0: DO
IF a%(j%) > 4 THEN
IF j% = k% THEN k% = k% + 1
a%(j%) = a%(j%) - 5: a%(j%) = a%(j%) * 2 + n%: n% = 1
ELSE
a%(j%) = a%(j%) * 2 + n%: n% = 0
END IF
IF j% = k% THEN EXIT DO
j% = j% + 1
LOOP
NEXT i%
FOR i% = 0 TO k%
a$ = LTRIM$(STR$(a%(i%))) + a$
NEXT i%

t2# = TIMER
PRINT a$
PRINT
PRINT t2# - t1#
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
#26
Whoa! You made this?
Reply
#27
..............

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.
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
#28
It's very nice, and fast :lol: but it doesent work for anything but 2^x


How would you do the 2 longs approach? (I can't get it to work) Cry
Reply
#29
a double is 64-bits, but it's floating point. Though you can get numbers up crazy high with the exponential notation it uses.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#30
I mean a 64bit Integer type, I think it's called a dword (double word), no decimals.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)