비트연산 shift left

(Left shift에서 넘어옴)

1 개요[ | ]

비트연산 shift left, left shift
왼쪽 시프트, 왼쪽 쉬프트, 왼쪽으로 시프트

2 Bash[ | ]

echo $(( 7 << 1 ))
# 14
echo $(( 7 << 2 ))
# 28

3 C[ | ]

#include<stdio.h>
int main() {
   printf("%d\n", 7<<0 ); // 7
   printf("%d\n", 7<<1 ); // 14
   printf("%d\n", 7<<2 ); // 28
   printf("%d\n", 7<<3 ); // 56
   printf("%d\n", 7<<4 ); // 112
}

4 PHP[ | ]

echo 7 << 1;
# 14
echo 7 << 2;
# 28

5 Python[ | ]

print 7 << 1
# 14
print 7 << 2
# 28

6 같이 보기[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}