bb.l=(64<<5/2)%65
Debug bb
result is 49
In Visual C++ Or Perl Or Other language
#include "stdafx.h"
#include <stdio.h>
int _tmain(int argc, _TCHAR* argv[])
{
int aa=0;
aa=(64<<5/2)%65;
printf("%d",aa);
return 0;
}
result is 61
help...
-
- PureBasic Expert
- Posts: 4229
- Joined: Sat Apr 26, 2003 8:27 am
- Location: Strasbourg / France
- Contact:
Re: help...
Code: Select all
bb.l=(64<<5/2)%65 ;-> 49
Debug bb
; same as
bb.l=((64<<5)/2)%65 ;-> 49
Debug bb
; because '<<' has priority over '/'
bb.l=(64<<(5/2))%65 ;-> 61
Debug bb
Code: Select all
Priority Level | Operators
---------------+---------------------
8 (high) | ~, -
7 | <<, >>, %, !
6 | |, &
5 | *, /
4 | +, -
3 | >, >=, <, <=, =, <>
2 | Not
1 (low) | And, Or, XOr
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Re: help...
thanks ,i tride add the (),and know it,Why are you(purebasic) different from the others
I have been accustomed to so use the << and /
so sorry for my poor english
I have been accustomed to so use the << and /
so sorry for my poor english
Win7X64 Purebasic5.22x86DEMO