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 / can't get bitewise operators working.

Author
Message
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 26th Aug 2011 02:43
I couldn't get the bitewise operators working:

EXP1: 5 || 10=15
EXP2: %0101 || %1010= %1111 which is 15.

now this is the code I wrote:



or



both programs will return 1, not 15.
am I doing any mistake or bitewise operators not implemented in tier 1.
LiamGoodacre
12
Years of Service
User Offline
Joined: 25th Aug 2011
Location:
Posted: 26th Aug 2011 03:46
I'm unsure about the Tier 1 language, but usually bit-wise 'or' is denoted with a single pipe: |
c = a | b

Have you tried that?
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 26th Aug 2011 15:59
or is always ||.
MobileCreator
12
Years of Service
User Offline
Joined: 1st Jun 2011
Location: Ottawa - Canada
Posted: 26th Aug 2011 18:55
It seems a bug for me.

The documentation says the operator for Bitwise OR is "||".

I did the test and it also returns 1 for me. The && works fine, though.

Cheers

Paulo
LiamGoodacre
12
Years of Service
User Offline
Joined: 25th Aug 2011
Location:
Posted: 26th Aug 2011 18:56
Have you worked it out?

All I was saying was that in Java, JavaScript, PHP, C, C++, Objective-C, etc...,
Boolean 'or' is double pipe ||
Bit-wise 'or' is a single pipe |
I assumed the Tier 1 language wouldn't be any different. But I'm using Tier 2 so I can't check.
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 27th Aug 2011 05:49
I do apologise to my colleagues in the forum as this post is back on the top.

@LiamGoodacre

bitwise operators in AppGameKit are represented the same way as DBpro but be careful!!, what is used as bitwise operators in AppGameKit is used as boolean operators in c/c++:

bitwise operators in AGK:
|| for OR
&& for and
~~ for xor
.. for not
<< left shift
>> right shift
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 27th Aug 2011 07:12
as well the XOR bitwise operator (~~) is not working properly. so a fault in OR bitwise operator |) and XOR bitwise operator (~~).
LeeBamber
TGC Lead Developer
24
Years of Service
User Offline
Joined: 21st Jan 2000
Location: England
Posted: 1st Sep 2011 03:10
Have you tried the new update 1.0.3.6?

I drink tea, and in my spare time I write software.
basjak
14
Years of Service
User Offline
Joined: 16th Apr 2010
Location: feel like signing up for mars
Posted: 2nd Sep 2011 15:27
working. thank you

Login to post a reply

Server time is: 2024-04-24 17:55:58
Your offset time is: 2024-04-24 17:55:58