{"id":6711,"date":"2016-03-15T06:23:25","date_gmt":"2016-03-14T21:23:25","guid":{"rendered":"http:\/\/www.webcyou.com\/?p=6711"},"modified":"2016-03-15T06:45:03","modified_gmt":"2016-03-14T21:45:03","slug":"javascript-%e3%83%93%e3%83%83%e3%83%88%e6%bc%94%e7%ae%97%e3%83%bb%e3%83%93%e3%83%83%e3%83%88%e3%83%9e%e3%82%b9%e3%82%af%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e3%81%be%e3%81%a8%e3%82%81%e3%81%a6%e3%81%bf","status":"publish","type":"post","link":"https:\/\/www.webcyou.com\/?p=6711","title":{"rendered":"JavaScript \u30d3\u30c3\u30c8\u6f14\u7b97\u30fb\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002"},"content":{"rendered":"<p><a href=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/479.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/479.jpg\" alt=\"479\" width=\"640\" height=\"369\" class=\"alignnone size-full wp-image-6713\" srcset=\"https:\/\/www.webcyou.com\/wp-content\/uploads\/479.jpg 640w, https:\/\/www.webcyou.com\/wp-content\/uploads\/479-300x173.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><br \/>\n\u3069\u3082\u3067\u3059\u3002<\/p>\n<p>\u6700\u8fd1\u3001\u8a18\u4e8b\u3082JavaScript\u3082\u66f8\u3044\u3066\u306a\u3044\u306a\u3041\u3002\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u306a\u3093\u304bJavaScript\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3059\u3002<\/p>\n<p>\u9078\u3093\u3060\u306e\u304c\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u30fb\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u3068\u8a00\u3046\u4e8b\u3067\u3001\u5168\u7136\u771f\u65b0\u3057\u304f\u3082\u7121\u304f\u3001\u4f7f\u3044\u3069\u3053\u308d\u306e\u5c11\u306a\u3044\u4e8b\u67c4\u3067\u5168\u304f\u7533\u3057\u8a33\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u307e\u3041\u3044\u3044\u3067\u3059\u3088\u306d\u3002<\/p>\n<p>\u307e\u3068\u3081\u3066\u3044\u306a\u3044\u306a\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u307e\u305f\u4eca\u66f4\u611f\u305f\u3063\u3077\u308a\u306a\u3093\u3067\u3059\u304c\u307e\u3068\u3081\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u901a\u5e38\u306eWeb\u30b5\u30a4\u30c8\u3084\u3001Web\u30b5\u30fc\u30d3\u30b9\u3092\u4f5c\u6210\u3059\u308b\u969b\u306f\u3001\u307b\u3068\u3093\u3069\u4f7f\u7528\u3059\u308b\u30b7\u30fc\u30f3\u3082\u7121\u304f\u3001\u79c1\u306e\u7d4c\u9a13\u4e0a\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u306a\u3069\u4f7f\u3063\u3066\u3044\u308b\u3068\u5468\u308a\u304b\u3089\u7159\u305f\u304c\u308c\u308b\u304b\u3068\u601d\u3044\u307e\u3059\uff08\u7b11\uff09<\/p>\n<p>\u672c\u5f53\u306b\u5fc5\u8981\u306a\u30b7\u30fc\u30f3\u306a\u3089\u3068\u3082\u304b\u304f\u3001<strong>\u300c\u3048\u3001\u3053\u3053\u3067\u3044\u308b\u304b\uff1f\u300d<\/strong>\u3063\u3066\u8a00\u3046\u306e\u304b\u3042\u3063\u305f\u4e8b\u3082\u3042\u308a\u307e\u3057\u3066\uff08\u7b11\uff09<\/p>\n<p>\u5b9f\u969b\u3001\u7159\u305f\u304c\u3063\u3066\u3044\u305f\u306e\u3082\u4e8b\u5b9f\u3067\u3059\uff08\u7b11\uff09<\/p>\n<p>\uff08\u306a\u3093\u304b\u3001\u66f8\u3051\u307e\u3059\u3088\u3002\u3063\u3066\u4e8b\u3092\u30a2\u30d4\u30fc\u30eb\u3057\u305f\u304b\u3063\u305f\u306e\u3067\u3057\u3087\u3046\u306d\uff08\u7b11\uff09\uff09<\/p>\n<p>\u3068\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3092\u5229\u7528\u3059\u308b\u30b7\u30fc\u30f3\u306f\u5c11\u306a\u3044\u5370\u8c61\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u3088\u304f\u3042\u308b\u306e\u304c<strong>\u30ab\u30e9\u30fc\u30b3\u30fc\u30c9\u3092\u6271\u3063\u305f\u308a<\/strong>\u3001\u30b2\u30fc\u30e0\u5236\u4f5c\u306e\u73fe\u5834\u3067\u306f<strong>\u30d3\u30c3\u30c8\u30de\u30b9\u30af<\/strong>\u306a\u3069\u3092\u7528\u3044\u305f\u6f14\u7b97\u3092\u7d50\u69cb\u5229\u7528\u3059\u308b\u4e8b\u304c\u591a\u3044\u3067\u3059\u306d\u3002<\/p>\n<p>\u8a73\u7d30\u306a\u3093\u3067\u3059\u304c\u3001\u306f\u3063\u304d\u308a\u8a00\u3044\u307e\u3057\u3066\u3001\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u306b\u307b\u3068\u3093\u3069\u8a18\u8f09\u3055\u308c\u3066\u3044\u307e\u3059\u304c\u3001<\/p>\n<p class=\"r\"><strong>JavaScript | MDN<\/strong><\/p>\n<p><a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/JavaScript\/Reference\/Operators\/Bitwise_Operators\" target=\"_blank\">\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50<\/a><\/p>\n<p>\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u30fb\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u3063\u3066\u4f55\uff1f\uff1f\u3063\u3066\u65b9\u5411\u3051\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u307e\u3068\u3081\u3089\u308c\u308c\u3070\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h4>\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50<\/h4>\n<p>\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3067\u306f\u305d\u306e\u30aa\u30da\u30e9\u30f3\u30c9\u3092 10 \u9032\u6570\u3084 16 \u9032\u6570\u3084 8 \u9032\u6570\u306e\u6570\u5024\u3067\u306f\u306a\u304f\u300132 \u30d3\u30c3\u30c8\u306e\u96c6\u5408\uff080 \u3068 1\uff09\u3068\u3057\u3066 \u6271\u3044\u307e\u3059\u3002<\/p>\n<p>\u3068\u3001\u3042\u308a\u307e\u3059\u306d\u3002<\/p>\n<p>\u305d\u3046\u3067\u3059\u306d\u3002\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u306f2\u9032\u6570\u306e\u8a08\u7b97\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>2\u9032\u6570\u3068\u306f\u300c0\u300d\u3068\u300c1\u300d\u306e2\u500b\u306e\u6570\u5b57\u3092\u4f7f\u3063\u3066\u6570\u3092\u8868\u73fe\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u306e2\u9032\u6570\u306e\u8a08\u7b97\u304c\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u6f14\u7b97\u5b50<\/th>\n<th>\u4f7f\u7528\u65b9\u6cd5<\/th>\n<th>\u8aac\u660e<\/th>\n<\/tr>\n<tr>\n<td>\u30d3\u30c3\u30c8\u3054\u3068\u306e AND<\/td>\n<td>a &#038; b<\/td>\n<td>\u30aa\u30da\u30e9\u30f3\u30c9\u306e\u5bfe\u5fdc\u3059\u308b\u30d3\u30c3\u30c8\u304c\u3068\u3082\u306b 1 \u3067\u3042\u308b\u5404\u30d3\u30c3\u30c8\u306b\u3064\u3044\u3066 1 \u3092\u8fd4\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u30d3\u30c3\u30c8\u3054\u3068\u306e OR<\/td>\n<td>a | b<\/td>\n<td>\u30aa\u30da\u30e9\u30f3\u30c9\u306e\u5bfe\u5fdc\u3059\u308b\u30d3\u30c3\u30c8\u304c\u3069\u3061\u3089\u304b\u307e\u305f\u306f\u3068\u3082\u306b 1 \u3067\u3042\u308b\u5404\u30d3\u30c3\u30c8\u306b\u3064\u3044\u3066 1 \u3092\u8fd4\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u30d3\u30c3\u30c8\u3054\u3068\u306e XOR<\/td>\n<td>a ^ b<\/td>\n<td>\u30aa\u30da\u30e9\u30f3\u30c9\u306e\u5bfe\u5fdc\u3059\u308b\u30d3\u30c3\u30c8\u304c\u3069\u3061\u3089\u304b\u4e00\u65b9\u306e\u307f 1 \u3067\u3042\u308b\u5404\u30d3\u30c3\u30c8\u306b\u3064\u3044\u3066 1 \u3092\u8fd4\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u30d3\u30c3\u30c8\u3054\u3068\u306e NOT<\/td>\n<td>~ a<\/td>\n<td>\u30aa\u30da\u30e9\u30f3\u30c9\u306e\u5404\u30d3\u30c3\u30c8\u3092\u53cd\u8ee2\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u5de6\u30b7\u30d5\u30c8<\/td>\n<td>\u00a0a &lt;&lt; b<\/td>\n<td>\u00a02 \u9032\u8868\u73fe\u306e <code>a<\/code> \u3092 <code>b<\/code> (&lt; 32) \u30d3\u30c3\u30c8\u5206\u3060\u3051\u5de6\u306b\u30b7\u30d5\u30c8\u3057\u307e\u3059\u3002\u53f3\u304b\u3089 0 \u3092\u8a70\u3081\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>\u7b26\u53f7\u3092\u7dad\u6301\u3057\u305f\u53f3\u30b7\u30d5\u30c8<\/td>\n<td>\u00a0a &gt;&gt; b<\/td>\n<td>\u00a02 \u9032\u8868\u73fe\u306e <code>a<\/code> \u3092 <code>b<\/code> (&lt; 32) \u30d3\u30c3\u30c8\u5206\u3060\u3051\u53f3\u306b\u30b7\u30d5\u30c8\u3057\u307e\u3059\u3002\u6ea2\u308c\u305f\u30d3\u30c3\u30c8\u306f\u7834\u68c4\u3057\u307e\u3059\u3002<\/td>\n<\/tr>\n<tr>\n<td>0 \u57cb\u3081\u53f3\u30b7\u30d5\u30c8<\/td>\n<td>\u00a0a &gt;&gt;&gt; b<\/td>\n<td>\u00a02 \u9032\u8868\u73fe\u306e <code>a<\/code> \u3092 <code>b<\/code> (&lt; 32) \u30d3\u30c3\u30c8\u5206\u3060\u3051\u53f3\u306b\u30b7\u30d5\u30c8\u3057\u307e\u3059\u3002\u6ea2\u308c\u305f\u30d3\u30c3\u30c8\u306f\u7834\u68c4\u3057\u3001\u5de6\u304b\u3089 0 \u3092\u8a70\u3081\u307e\u3059\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u307e\u308b\u3063\u3068\u3001\u5f15\u7528\u3067\u7533\u3057\u8a33\u306a\u3044\u306e\u3067\u3059\u304c\u3001\u4e0a\u8a18\u304c\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u3001<strong>\u300cAND\u300d\u300cOR\u300d\u300cXOR\u300d\u300cNOT\u300d<\/strong>\u306b\u6ce8\u76ee\u3057\u3066\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u3002<\/p>\n<p>a\u3068b\u306e2\u3064\u306e2\u9032\u6570\u3092\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3067\u6f14\u7b97\u3057\u305f\u4f8b\u3067\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>b<\/th>\n<th>\u8ad6\u7406\u7a4d AND\uff08a&#038;b\uff09<\/th>\n<th>\u8ad6\u7406\u548cOR\uff08a | b\uff09<\/th>\n<th>\u6392\u4ed6\u7684\u8ad6\u7406\u548cXOR\uff08a^b\uff09<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>\u8ad6\u7406\u5426\u5b9aNOT\uff08~a\uff09<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3046\u30fc\u3002\u308f\u304b\u3093\u306a\u3044\u3088\u30fc\u3002\u3063\u3066\u65b9\u306b\u5c11\u3057\u5206\u304b\u308a\u3084\u3059\u304f\u565b\u307f\u7815\u3044\u3066\u66f8\u3044\u3066\u3044\u304d\u307e\u3059\u306d\u3002<\/p>\n<p>\u307e\u305a\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u306b\u5165\u308b\u524d\u306b\u3001\u6570\u5024\u30ea\u30c6\u30e9\u30eb\u306b\u3064\u3044\u3066\u5fa9\u7fd2\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<h5>\u30d8\u30ad\u30b5\u30ea\u30c6\u30e9\u30eb<\/h5>\n<p>\u6700\u5148\u982d\u306b\u300e0x\u300f \u3067\u300116 \u9032\u6570\u8868\u8a18\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/ 16 \u9032\u6570\u8868\u8a18\u3067\u6570\u5024\u3092\u4f5c\u6210\u3059\u308b\r\nvar value = 0x00000112; \/\/274<\/pre>\n<h5>\u30aa\u30af\u30bf\u30eb\u30ea\u30c6\u30e9\u30eb\uff08\u975e\u63a8\u5968\u4ed5\u69d8\uff09<\/h5>\n<p>\u6700\u5148\u982d\u306b\u300e0\u300f \u3067\u30018 \u9032\u6570\u8868\u8a18\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/ 8 \u9032\u6570\u8868\u8a18\u3067\u6570\u5024\u3092\u4f5c\u6210\u3059\u308b\uff08\u975e\u63a8\u5968\uff09\r\nvar value = 021; \/\/17<\/pre>\n<p>\u975e\u63a8\u5968\u306e\u70ba\u3001strict \u30e2\u30fc\u30c9\u3067\u306f\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002<\/p>\n<p>&nbsp;<\/p>\n<h5>\u30aa\u30af\u30bf\u30eb\u30ea\u30c6\u30e9\u30eb<\/h5>\n<p>\u6700\u5148\u982d\u306b\u300e0o\u300f \u3067\u30018 \u9032\u6570\u8868\u8a18\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/ 8 \u9032\u6570\u8868\u8a18\u3067\u6570\u5024\u3092\u4f5c\u6210\u3059\u308b\r\nvar value = 0o0021; \/\/17<\/pre>\n<p>\u65b0\u4ed5\u69d8\u306e\u70ba\u3001\u4e00\u90e8\u30d6\u30e9\u30a6\u30b6\u3067\u52d5\u4f5c\u3002<\/p>\n<h5>\u30d0\u30a4\u30ca\u30ea\u30ea\u30c6\u30e9\u30eb<\/h5>\n<p>\u6700\u5148\u982d\u306b\u300e0b\u300f \u3067\u30012 \u9032\u6570\u8868\u8a18\u3068\u306a\u308a\u307e\u3059<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\/\/ 2 \u9032\u6570\u8868\u8a18\u3067\u6570\u5024\u3092\u4f5c\u6210\u3059\u308b\r\nvar value = 0b0010; \/\/2<\/pre>\n<p>\u4e00\u90e8\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u52d5\u4f5c\u3057\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<h4>\u8ad6\u7406\u6f14\u7b97\u5b50<\/h4>\n<h5>&#038; (\u30d3\u30c3\u30c8\u3054\u3068\u306e AND)<\/h5>\n<p>\u307e\u305a\u306f\u3001\u300cAND\u300d\u304b\u3089\u3002<\/p>\n<p>\u8ad6\u7406\u7a4dAND\u306f\u3001\u300c\u3069\u3061\u3089\u30821\u306e\u5834\u54081\u3002\u305d\u308c\u4ee5\u59160\u300d\u3067\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>b<\/th>\n<th>\u8ad6\u7406\u7a4d AND\uff08a&#038;b\uff09<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>1010 &#038; 1100 = 1000 \uff082\u9032\u6570\uff09<\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>10\uff0810\u9032\u6570\uff09 =\u00a01010\uff082\u9032\u6570\uff09<\/p>\n<p>12\uff0810\u9032\u6570\uff09 =\u00a01100\uff082\u9032\u6570\uff09<\/p>\n<p>10 &#038; 12 =\u00a01000\uff082\u9032\u6570\uff09= 8\uff0810\u9032\u6570\uff09<\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>| (\u30d3\u30c3\u30c8\u3054\u3068\u306e OR)<\/h5>\n<p>\u8ad6\u7406\u548cOR\uff08a | b\uff09\u306f\u3069\u3061\u3089\u304b\u30011\u306e\u5834\u54081\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>b<\/th>\n<th>\u8ad6\u7406\u548cOR\uff08a | b\uff09<\/th>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>0<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>1010 | 0011 = 1011\uff082\u9032\u6570\uff09<\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>10\uff0810\u9032\u6570\uff09 =\u00a01010\uff082\u9032\u6570\uff09<\/p>\n<p>3\uff0810\u9032\u6570\uff09 = 0011\uff082\u9032\u6570\uff09<\/p>\n<p>10 | 3 =\u00a01011\uff082\u9032\u6570\uff09= 11\uff0810\u9032\u6570\uff09<\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>^ (\u30d3\u30c3\u30c8\u3054\u3068\u306e XOR)<\/h5>\n<p>\u6392\u4ed6\u7684\u8ad6\u7406\u548cXOR\u306f\u300c\u3069\u3061\u3089\u304b\u7570\u306a\u308b\u5834\u5408 1\u3068\u306a\u308a\u307e\u3059\u300d<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>b<\/th>\n<th>\u6392\u4ed6\u7684\u8ad6\u7406\u548cXOR\uff08a^b\uff09<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>1010 ^ 0011 = 1001\uff082\u9032\u6570\uff09<\/p>\n<p>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>10\uff0810\u9032\u6570\uff09 =\u00a01010\uff082\u9032\u6570\uff09<\/p>\n<p>3\uff0810\u9032\u6570\uff09 = 0011\uff082\u9032\u6570\uff09<\/p>\n<p>10 ^\u00a03 =\u00a01001\uff082\u9032\u6570\uff09= 9\uff0810\u9032\u6570\uff09<br \/>\n\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>~ (\u30d3\u30c3\u30c8\u3054\u3068\u306e NOT)<\/h5>\n<p>\u6700\u5f8c\u3001\u8ad6\u7406\u5426\u5b9aNOT\u306f\u3001\u300c\u5168\u3066\u306e\u30d3\u30c3\u30c8\u3092\u53cd\u8ee2\u3055\u305b\u307e\u3059\u300d<\/p>\n<table>\n<tbody>\n<tr>\n<th>a<\/th>\n<th>\u8ad6\u7406\u5426\u5b9aNOT\uff08~a\uff09<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>0<\/td>\n<\/tr>\n<tr>\n<td>0<\/td>\n<td>1<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>9 (10 \u9032\u6570) = 1001 (2 \u9032\u6570)<br \/>\n~9 (10 \u9032\u6570) = 0110 (2 \u9032\u6570) = -10 (10 \u9032\u6570)<\/p>\n<h4>\u30d3\u30c3\u30c8\u30de\u30b9\u30af<\/h4>\n<p>\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u306b\u3064\u3044\u3066\u3001\u30b6\u30c3\u3068\u3067\u306f\u3042\u308a\u307e\u3059\u304c\u3001\u632f\u308a\u8fd4\u3063\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u3067\u306f\u3001<strong>\u300c\u3069\u3053\u3067\u4f7f\u3046\u306e\uff1f\u300d<\/strong>\u3068\u7591\u554f\u3082\u4e0a\u304c\u3063\u3066\u304f\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b\u4f7f\u3046\u30b7\u30fc\u30f3\u306f\u4e00\u3064\u306e\u5909\u6570\u3067\u3001<strong>\u30d0\u30a4\u30ca\u30ea\u30d5\u30e9\u30b0\u3068\u3057\u3066\u6301\u3064\u3001\u300c\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u300d<\/strong>\u304c\u30b2\u30fc\u30e0\u5236\u4f5c\u306e\u73fe\u5834\u3067\u4f7f\u7528\u3055\u308c\u305f\u308a\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u3068\u306f\u3001\u901a\u5e38\u300c\u771f\uff08true\uff09\u300d\u300c\b\u507d\uff08false\uff09\u300d\u3092\u8868\u3059 bool\u578b\u306f2\u7a2e\u985e\u3057\u304b\u306a\u304f\u300c\u771f\uff08true\uff091\u300d\u300c\b\u507d\uff08false\uff090\u300d\u3067\u8868\u73fe\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e<strong>\u300c0\u300d\u300c1\u300d\u306e1\u30d3\u30c3\u30c8\u306e\u6570\u5024\u3092\u7528\u3044\u3066\u30011\u3064\u306e\u5909\u6570\u3067\u8907\u6570\u306e\u30d5\u30e9\u30b0<\/strong>\u3092\u8868\u73fe\u3059\u308b\u306e\u304c\u3001\u300c\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u300d\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3067\u306f\u3001\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u306e\u5b9a\u7fa9\u4f8b\u3092\u3002<\/p>\n<table>\n<tbody>\n<tr>\n<th>\u5b9a\u6570\u540d<\/th>\n<th>2\u9032\u6570<\/th>\n<th>10\u9032\u6570<\/th>\n<th>16\u9032\u6570<\/th>\n<th>\u6982\u8981<\/th>\n<\/tr>\n<tr>\n<td>NONE<\/td>\n<td>00000000<\/td>\n<td>0<\/td>\n<td>0x0000<\/td>\n<td>\u4f55\u3082\u98fc\u3063\u3066\u3044\u306a\u3044<\/td>\n<\/tr>\n<tr>\n<td>CAT<\/td>\n<td>00000001<\/td>\n<td>1<\/td>\n<td>0x0001<\/td>\n<td>\u732b\u3092\u98fc\u3063\u3066\u3044\u308b<\/td>\n<\/tr>\n<tr>\n<td>DOG<\/td>\n<td>00000010<\/td>\n<td>2<\/td>\n<td>0x0002<\/td>\n<td>\u72ac\u3092\u98fc\u3063\u3066\u3044\u308b<\/td>\n<\/tr>\n<tr>\n<td>BIRD<\/td>\n<td>00000100<\/td>\n<td>4<\/td>\n<td>0x0004<\/td>\n<td>\u9ce5\u3092\u98fc\u3063\u3066\u3044\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u3053\u306e\u3088\u3046\u306a\u5b9a\u6570\u304c\u5b9a\u7fa9\u3055\u308c\u3066\u3044\u305f\u3068\u3057\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u306b\u4f7f\u3046\u306e\u306f<strong>\u300c\u8ad6\u7406\u7a4dAND\u300d\u3068\u300c\u8ad6\u7406\u548cOR\u300d<\/strong>\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u3042\u308b\u5909\u6570\u306b\u300cCAT\u300d\u306e\u30d5\u30e9\u30b0\u3092\u7acb\u3066\u308b\u6642\u306f\u3001\u300cOR\u300d\u3092\u7528\u3044\u3066\u30d5\u30e9\u30b0\u3092true\u306b\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">man = man | CAT;<\/pre>\n<p>\u3053\u308c\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8a18\u8ff0\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">man |=\u00a0CAT;<\/pre>\n<p>\u9006\u306b\u30d5\u30e9\u30b0\u304c\u7acb\u3063\u3066\u3044\u308b\u304b\u5224\u5b9a\u306e\u5834\u5408\u306f\u300cAND\u300d\u3092\u7528\u3044\u3066\u5224\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if((man & CAT) != 0) {\r\n\u51e6\u7406..\r\n}<\/pre>\n<p>\u732b\u3068\u72ac\u3092\u98fc\u3063\u3066\u3044\u308b\u5834\u5408\u306e\u307f\u51e6\u7406\u3092\u884c\u3046\u5834\u5408\u306f\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if ((man & CAT) && (man & DOG)) {\r\n  \u51e6\u7406..\r\n}<\/pre>\n<p>\u307f\u305f\u3044\u306a\u611f\u3058\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>\u732b\u304b\u72ac\u3092\u98fc\u3063\u3066\u3044\u308b\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u5909\u6570\u3092\u4f5c\u6210\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">var mask = CAT | DOG;<\/pre>\n<p>\u3053\u306e\u3088\u3046\u306b\u3001\u300cOR\u6f14\u7b97\u300d\u3092\u7528\u3044\u3066\u4f5c\u6210\u3059\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u306f 0 \u3068\u306e AND \u6f14\u7b97\u306b\u3088\u308a\u3001\u95a2\u4fc2\u306e\u306a\u3044\u30d5\u30e9\u30b0\u3092<em>\u30de\u30b9\u30af<\/em>\u3057\u307e\u3059 (\u305d\u308c\u3086\u3048\u3001&#8221;\u30d3\u30c3\u30c8\u30de\u30b9\u30af&#8221; \u3068\u3044\u3046\u7528\u8a9e\u306b\u306a\u308a\u307e\u3059)\u3002<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">if (man & mask) \u00a0{\r\n  \u51e6\u7406..\r\n}<\/pre>\n<p>&nbsp;<\/p>\n<p>\u3068\u3001\u8a00\u3063\u305f\u611f\u3058\u306b\u5229\u7528\u3055\u308c\u307e\u3059\u3002<\/p>\n<p>\u30b6\u30c3\u3068\u3067\u306f\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u5b50\u3001\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u306b\u95a2\u3057\u3066\u8efd\u304f\u307e\u3068\u3081\u3066\u307f\u307e\u3057\u305f\u3002<\/p>\n<p>\u901a\u5e38\u306eWeb\u30b5\u30a4\u30c8\u3084Web\u30b5\u30fc\u30d3\u30b9\u3067\u306f\u306a\u304b\u306a\u304b\u4f7f\u3046\u6a5f\u4f1a\u3082\u5c11\u306a\u3044\u3067\u3059\u304c\u3001\u899a\u3048\u3066\u304a\u3044\u3066\u640d\u306f\u7121\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<br \/>\n\uff08\u5fc5\u8981\u7121\u3044\u306e\u306b\u3001\u3080\u3084\u307f\u3084\u305f\u3089\u306b\u4f7f\u3046\u306e\u306f\u3084\u3081\u307e\u3057\u3087\u3046\uff08\u88ab\u5bb3\u7d4c\u9a13\u3042\u308a\uff09\uff08\u7b11\uff09\uff09<\/p>\n<p>\u6b21\u306f\u8a55\u4fa1\u95a2\u6570\u8fba\u308a\u66f8\u3051\u3066\u884c\u3051\u308c\u3070\u3068\u601d\u3046\u4eca\u65e5\u3053\u306e\u9803\u3067\u3059\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u30fc\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3069\u3082\u3067\u3059\u3002 \u6700\u8fd1\u3001\u8a18\u4e8b\u3082JavaScript\u3082\u66f8\u3044\u3066\u306a\u3044\u306a\u3041\u3002\u3068\u601d\u3063\u305f\u306e\u3067\u3001\u306a\u3093\u304bJavaScript\u306b\u3064\u3044\u3066\u66f8\u304d\u307e\u3059\u3002 \u9078\u3093\u3060\u306e\u304c\u3001\u30d3\u30c3\u30c8\u6f14\u7b97\u30fb\u30d3\u30c3\u30c8\u30de\u30b9\u30af\u3068\u8a00\u3046\u4e8b\u3067\u3001\u5168\u7136\u771f\u65b0\u3057\u304f\u3082\u7121\u304f\u3001\u4f7f\u3044\u3069\u3053\u308d\u306e\u5c11\u306a\u3044\u4e8b\u67c4\u3067\u5168\u304f\u7533 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[168,176,40,166,37,47,179,50,46,169,173,45,39,138],"class_list":["post-6711","post","type-post","status-publish","format-standard","hentry","category-javascript","tag-html","tag-html5","tag-ios-sdk","tag-iphone","tag-iphone-","tag-javascript-2","tag-jquery","tag-jquery-mobile","tag-js","tag-mac","tag-php","tag-web","tag-39","tag-138"],"_links":{"self":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6711","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6711"}],"version-history":[{"count":8,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6711\/revisions"}],"predecessor-version":[{"id":6720,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=\/wp\/v2\/posts\/6711\/revisions\/6720"}],"wp:attachment":[{"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6711"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6711"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcyou.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6711"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}