<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>suzaku0914</author_name>
  <author_url>https://blog.hatena.ne.jp/suzaku0914/</author_url>
  <blog_title>エンターテイメント！！</blog_title>
  <blog_url>https://suzaku-tec.hatenadiary.jp/</blog_url>
  <categories>
    <anon>Swift</anon>
    <anon>プログラミング</anon>
    <anon>情報収集</anon>
  </categories>
  <description>きっかけ 実証 参考サイト きっかけ swiftで割り算したら、予想と違った挙動をしたので、メモ。 実証 print(3 / 2) 期待値としては、1.5が出て欲しいが、上記コードを実行すると $swift sample.swift 1 1になる。 Int型で割り算すると、結果は、Int型になる。 小数点以下は、切り捨て。 小数点以下も欲しい場合は、どちらかをDoubleにする必要がある。 結果をDouble型にしても、小数点は切り捨てられたまま。 print(Double(3 / 2)) // -&gt; 1.0 小数点以下も欲しい場合は、どちらかをDoubleにすればいい。 print(3.0 …</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fsuzaku-tec.hatenadiary.jp%2Fentry%2F2020%2F01%2F12%2F223438&quot; title=&quot;swiftの割り算での型 - エンターテイメント！！&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-01-12 22:34:38</published>
  <title>swiftの割り算での型</title>
  <type>rich</type>
  <url>https://suzaku-tec.hatenadiary.jp/entry/2020/01/12/223438</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
