<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>moritomo7315</author_name>
  <author_url>https://blog.hatena.ne.jp/moritomo7315/</author_url>
  <blog_title>登山好きエンジニアのテックブログ</blog_title>
  <blog_url>https://moritomo7315.hatenablog.com/</blog_url>
  <categories>
    <anon>アウトプット</anon>
    <anon>プログラミング</anon>
    <anon>C/C++</anon>
  </categories>
  <description>少数第3位で四捨五入をする必要があったので、メモがてらシェアしておきます。 今回やりたいことは、 例えば0.165895235であれば、0.17に四捨五入をしたい。 というように、C++言語で小数点以下のn番目で四捨五入をするにはどうすればいいかシェアします。 C++言語の四捨五入のためのライブラリについて C++にはcmath.hに四捨五入をする関数が含まれています。 cpprefjp.github.io こちらの関数の問題は、小数点以下を四捨五入して整数に丸めている点です。 そのため、小数点第n位で四捨五入することはできません。 round関数を使った関数実装 では小数点以下のn番目で四捨…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fmoritomo7315.hatenablog.com%2Fentry%2F2019%2F02%2F09%2F140757&quot; title=&quot;C++言語で少数第n位で四捨五入する - 登山好きエンジニアのテックブログ&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>2019-02-09 14:07:57</published>
  <title>C++言語で少数第n位で四捨五入する</title>
  <type>rich</type>
  <url>https://moritomo7315.hatenablog.com/entry/2019/02/09/140757</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
