<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>atsuhiro-me</author_name>
  <author_url>https://blog.hatena.ne.jp/atsuhiro-me/</author_url>
  <blog_title>みーのぺーじ</blog_title>
  <blog_url>https://pc.atsuhiro-me.net/</blog_url>
  <categories>
    <anon>Python</anon>
  </categories>
  <description>Python入門｜絶対値を求めるabs関数の使い方 という記事に，Pythonで絶対値を得る方法が解説されていました． 一般的な絶対値の求め方は対象となる数値を二乗した後に平方根を求めることで±記号を取り除きます。 そんな面倒なことをしなくても，負の数ならば-1をかければよいのではないかと思いますが，二乗して平方根を求める方法について掘り下げてみます． macOS, 64bit cpu, Python3.8で検証しました． 入力が整数だと小数になる問題 import math def abs_by_sqrt(v): return math.sqrt(v**2) def abs_by_if(v)…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fpc.atsuhiro-me.net%2Fentry%2F2020%2F08%2F22%2F203928&quot; title=&quot;abs()の解説記事の違和感 - みーのぺーじ&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-08-22 20:39:28</published>
  <title>abs()の解説記事の違和感</title>
  <type>rich</type>
  <url>https://pc.atsuhiro-me.net/entry/2020/08/22/203928</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
