<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>moznion</author_name>
  <author_url>https://blog.hatena.ne.jp/moznion/</author_url>
  <blog_title>その手の平は尻もつかめるさ</blog_title>
  <blog_url>https://moznion.hatenadiary.com/</blog_url>
  <categories>
    <anon>zig</anon>
  </categories>
  <description>なんとなくZigを触っているのですが、ビットシフト演算が独特の挙動で面白かったです。 const n: u8 = 0b00000001; const shifted: u8 = n &lt;&lt; 1; std.debug.print(&quot;{b}\n&quot;, .{shifted}); // =&gt; 0b00000010 これは直感的なコードでしょう。n が1バイト左にシフトしています。さて以下のコードはどうでしょうか。 const n: u8 = 0b00000001; const shifted: u8 = n &lt;&lt; 8; std.debug.print(&quot;{b}\n&quot;, .{shifted}); // ex…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmoznion.hatenadiary.com%2Fentry%2F2022%2F08%2F13%2F105732&quot; title=&quot;Zigのビットシフト演算がちょっと面白い - その手の平は尻もつかめるさ&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2022-08-13 10:57:32</published>
  <title>Zigのビットシフト演算がちょっと面白い</title>
  <type>rich</type>
  <url>https://moznion.hatenadiary.com/entry/2022/08/13/105732</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
