<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>potisan</author_name>
  <author_url>https://blog.hatena.ne.jp/potisan/</author_url>
  <blog_title>potisanのプログラミングメモ</blog_title>
  <blog_url>https://potisan-programming-memo.hatenablog.jp/</blog_url>
  <categories>
    <anon>C#</anon>
  </categories>
  <description>ushort型の加減算のはみ出し switch式による加減算はみ出しの抑制 isのvarパターンによるはみ出し抑制 Math.Clampによる例 ushort型の加減算のはみ出し ushort型はint型として加減算されるため、計算結果がushortの範囲（0-0xffff）をはみ出す場合があります。単純にunchecked((ushort)...)を適用した場合、はみ出した値は... &amp; 0xffffの結果となり想定外の値が得られる場合があります。 Console.WriteLine(unchecked((ushort)(2u - 5u))); // 65533 Console.WriteL…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpotisan-programming-memo.hatenablog.jp%2Fentry%2F2020%2F12%2F02%2F003610&quot; title=&quot;C# 9.0 ushortのushort範囲制限加減算 - potisanのプログラミングメモ&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>2020-12-02 00:36:10</published>
  <title>C# 9.0 ushortのushort範囲制限加減算</title>
  <type>rich</type>
  <url>https://potisan-programming-memo.hatenablog.jp/entry/2020/12/02/003610</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
