javascript/Reference2011.09.04 11:22

-     산술 연산자

 

예제http://cafefiles.naver.net/20120103_14/sgtsong75_1325586843789WAFzY_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2817%29_sgtsong75.gif

설명http://cafefiles.naver.net/20120103_120/sgtsong75_1325586842732eg42h_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2810%29_sgtsong75.gif

a + bhttp://cafefiles.naver.net/20120103_59/sgtsong75_1325586842594yg6Rh_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%289%29_sgtsong75.gif

a b더하기

a - b

a 빼기 b

a * b

a b 곱하기

a / b

a b로 나누기

a % bhttp://cafefiles.naver.net/20120103_54/sgtsong75_1325586842422n8Ch2_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%288%29_sgtsong75.gif

a b로 나눈 나머지

a ++

a의 값을 1 증가

a --http://cafefiles.naver.net/20120103_211/sgtsong75_1325586841878lD8PJ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%285%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_211/sgtsong75_1325586841878lD8PJ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%285%29_sgtsong75.gif

a의 값을 1 감소

 

 

-     대입 연산자

예제

설명

a = bhttp://cafefiles.naver.net/20120103_211/sgtsong75_1325586841878lD8PJ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%285%29_sgtsong75.gif

b a에 대입http://cafefiles.naver.net/20120103_120/sgtsong75_1325586842732eg42h_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2810%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_120/sgtsong75_1325586842732eg42h_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2810%29_sgtsong75.gif

a + = b

a = a + b

a -= bhttp://cafefiles.naver.net/20120103_159/sgtsong75_1325586844249cKcCP_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2820%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_159/sgtsong75_1325586844249cKcCP_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2820%29_sgtsong75.gif

a = a – b

a *= b

a = a * b

a / = bhttp://cafefiles.naver.net/20120103_52/sgtsong75_1325586841574FTBFK_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%283%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_52/sgtsong75_1325586841574FTBFK_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%283%29_sgtsong75.gif

a = a / b

a % = b

a = a % b

 

 

-     비트 연산자

예제

설명

a | bhttp://cafefiles.naver.net/20120103_211/sgtsong75_1325586841878lD8PJ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%285%29_sgtsong75.gif

a, b ORhttp://cafefiles.naver.net/20120103_54/sgtsong75_1325586842422n8Ch2_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%288%29_sgtsong75.gif

a & b

a, b AND

~ ahttp://cafefiles.naver.net/20120103_139/sgtsong75_1325586842257uuwGj_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%287%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_139/sgtsong75_1325586842257uuwGj_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%287%29_sgtsong75.gif

a 부정 (모든 비트 반전)http://cafefiles.naver.net/20120103_163/sgtsong75_1325586843627Hkrym_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2816%29_sgtsong75.gif

a <<1

a를 왼쪽으로 1 비트 시프트 (2 )

a>> 1http://cafefiles.naver.net/20120103_46/sgtsong75_1325586841410Xw9nQ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%282%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_46/sgtsong75_1325586841410Xw9nQ_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%282%29_sgtsong75.gif

a를 왼쪽으로 1 비트 시프트 (1 / 2)http://cafefiles.naver.net/20120103_54/sgtsong75_1325586842422n8Ch2_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%288%29_sgtsong75.gif

 

 

-     비교 연산자

예제http://cafefiles.naver.net/20120103_159/sgtsong75_1325586844249cKcCP_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2820%29_sgtsong75.gif

설명http://cafefiles.naver.net/20120103_256/sgtsong75_1325586842108aTk2o_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%286%29_sgtsong75.gif

a == bhttp://cafefiles.naver.net/20120103_54/sgtsong75_1325586842422n8Ch2_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%288%29_sgtsong75.gif

동일

a != b

같지 않음

a > bhttp://cafefiles.naver.net/20120103_110/sgtsong75_1325586841726w3PrC_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%284%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_110/sgtsong75_1325586841726w3PrC_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%284%29_sgtsong75.gif

a b보다 크다

a >= b

a b보다 크거나 같다

a < bhttp://cafefiles.naver.net/20120103_120/sgtsong75_1325586842732eg42h_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2810%29_sgtsong75.gifhttp://cafefiles.naver.net/20120103_120/sgtsong75_1325586842732eg42h_gif/%BB%E7%BA%BB_-_%B9%AB%C1%A6-1_%2810%29_sgtsong75.gif

a b보다 작다

a <= b

a b 보다 작거나 같다

 

Posted by 하품 - yawn 하품 - yawn

댓글을 달아 주세요