[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] question re calculation speed difference in assignment statement in AFL



PureBytes Links

Trading Reference Links



Richard --
You have to think like a computer does.  For K+=2, computer must (simplified version):
1. Get value of 2
2. Add it to K

For K = K+=2, computer must
(simplified version):
1. Get value of K
2. Get value of 2
3. Add the two values
4. Store results in K

It's actually more complicated, because, depending on the actual hardware (cpu) available, some or even all of the simplified steps above require multiple, low level instructions.  But that is the general idea.
-- Keith

Richard wrote:
 

hi there

K+=2 assigns at a faster speed than k=k+2 though they are identical in their result*

why is this?

*(as cited on pg 333 of the AB 5.20 user's guide)

greetings
timekeeper (aka richard)



__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___