Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / [correct] Question about bitwise operators in Tier 1...

Author
Message
nickele upgraded
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Birthplace of Democracy
Posted: 19th Mar 2014 13:56
(Please forgive previous unfinished post -if it survived)

Can anyone answer me a simple question please?

Do bitwise operators work correctly in Tier 1?

If yes... How can we use bitwise operators to change variable values?

Example: If I use in my program
a=1
a=a<<1
I get always zero as result, while I was expecting two.

I use AppGameKit 1.0821 Tier 1.

"For Those About to Program We Salute You"
Markus
Valued Member
20
Years of Service
User Offline
Joined: 10th Apr 2004
Location: Germany
Posted: 20th Mar 2014 13:45
i get 2 in result
108 19


http://www.appgamekit.com/documentation/principles/2_operators.htm

AGK 108 (B)19 : Windows 8.1 Pro 64 Bit : AMD Radeon HD 6670
Digital Awakening
AGK Developer
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 20th Mar 2014 14:14
Thanks Markus, I didn't know AppGameKit could do that

nickele upgraded
10
Years of Service
User Offline
Joined: 20th Dec 2013
Location: Birthplace of Democracy
Posted: 20th Mar 2014 14:41
Thank you for your replies.

You are correct and there is no problem with the AppGameKit version.

I just forgot to properly initialize the variable and it was zeroed before it reached the bitwise operator.

"For Those About to Program We Salute You"

Login to post a reply

Server time is: 2024-11-25 03:23:35
Your offset time is: 2024-11-25 03:23:35