>> in calculations
#1

Hi, I'm fiddling with maths and calculations in sa-mp, I checked some posts and found people using >> and << in calculations. What does it mean? What does it do?
I did some test calculations with the following results...:

4>>0=4
4>>1=2
4>>2=1
4>>3=0
4>>4=0
4>>5=0
4>>6=0
4>>7=0
4>>8=0
4>>9=0
4>>10=0
4>>11=0
4>>12=0
4>>13=0
4>>14=0
4>>15=0
4>>16=0
4>>17=0
4>>18=0
4>>19=0
4>>20=0
4>>21=0
4>>22=0
4>>23=0
4>>24=0
4>>25=0
4>>26=0
4>>27=0
4>>28=0
4>>29=0
4>>30=0
4>>31=0
4>>32=4
4>>33=2
4>>34=1


What does it mean, and what does it do? Thanks in advance!
Reply
#2

It's bit shifting, for use with binary(?), there is a section on it here.

https://sampforum.blast.hk/showthread.php?tid=177523
Reply
#3

Awesome! Thanks!
Reply
#4

Have this table:

Power 7 6 5 4 3 2 1 0
Decimal 128 64 32 16 8 4 2 1
Binary 1000 0000 0100 0000 0010 0000 0001 0000 0000 1000 0000 0100 0000 0010 0000 0001
Notice a patern?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)