<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>hnw</author_name>
  <author_url>https://blog.hatena.ne.jp/hnw/</author_url>
  <blog_title>hnwの日記</blog_title>
  <blog_url>https://hnw.hatenablog.com/</blog_url>
  <categories>
    <anon>浮動小数点数</anon>
    <anon>PHP</anon>
  </categories>
  <description>各種プログラミング言語には、切り上げ・切り捨て・四捨五入など浮動小数点数を丸める関数が何種類もあります。こうした丸め処理を利用する際、「ceilとfloorどっちがどっちだっけ？」「マイナスの数が来た時の挙動って大丈夫なんだっけ？」などと不安になることはないでしょうか。 僕が丸め関数を使うときは、バグが無いかどうか他の場所以上に警戒します。というのも、これらの関数は境界値ピッタリだった場合の挙動とマイナスの数に対する挙動がそれぞれ違っており、勘違いや考え漏れから境界値バグを作り込みやすいためです。僕と同じ感覚の人も多いのではないでしょうか。 本稿では、こうした関数の挙動が一目でわかる便利なグラ…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fhnw.hatenablog.com%2Fentry%2F20111029&quot; title=&quot;浮動小数点数の丸め処理を見比べてみる - hnwの日記&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>2011-10-29 00:00:00</published>
  <title>浮動小数点数の丸め処理を見比べてみる</title>
  <type>rich</type>
  <url>https://hnw.hatenablog.com/entry/20111029</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
