{"description":"C++\u8a00\u8a9e\u306b\u304a\u3051\u308b\u7b26\u53f7\u4ed8\u304d\u6574\u6570\u578b\u306e\u5de6\u30d3\u30c3\u30c8\u30b7\u30d5\u30c8<<\u3068\u7b26\u53f7\u30d3\u30c3\u30c8\u306e\u95a2\u4fc2\u306b\u3064\u3044\u3066\u3002\u307e\u3068\u3081\uff1a 2\u306e\u88dc\u6570\u8868\u73fe\u304c\u4fdd\u8a3c\u3055\u308c\u305fC++20\u73fe\u5728\u3001\u5de6\u30d3\u30c3\u30c8\u30b7\u30d5\u30c8<<\u306f\u8ad6\u7406\u5de6\u30b7\u30d5\u30c8(logical left shift)\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3002 \u304a\u307e\u3051\uff1aC++20\u73fe\u5728\u3001\u53f3\u30d3\u30c3\u30c8\u30b7\u30d5\u30c8>>\u306f\u7b97\u8853\u53f3\u30b7\u30d5\u30c8(arithmetic right shift)\u304c\u4fdd\u8a3c\u3055\u308c\u308b\u3002 // \u524d\u63d0\uff1aint\u578b==32bit\u5e45 constexpr int x = 1 << 31; // x == -2147483648 (== -2^{31}) C++11\u6642\u70b9\u3067\u306f\u7b26\u53f7\u53cd\u8ee2\u3092\u4f34\u3046\u5de6\u30d3\u30c3\u30c8\u30b7\u30d5\u30c8\u6f14\u7b97\u306f\u672a\u5b9a\u7fa9\u52d5\u4f5c(undefined behavior)\u3067\u2026","blog_url":"https://yohhoy.hatenadiary.jp/","provider_url":"https://hatena.blog","url":"https://yohhoy.hatenadiary.jp/entry/20211108/p1","width":"100%","image_url":null,"provider_name":"Hatena Blog","author_name":"yohhoy","published":"2021-11-08 00:00:00","blog_title":"yohhoy\u306e\u65e5\u8a18","type":"rich","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fyohhoy.hatenadiary.jp%2Fentry%2F20211108%2Fp1\" title=\"1 &lt;&lt; 31 == ? - yohhoy\u306e\u65e5\u8a18\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","categories":["C++"],"height":"190","title":"1 << 31 == ?","version":"1.0","author_url":"https://blog.hatena.ne.jp/yohhoy/"}