2023-06-22 Python - math.nextafter(x,y):xからyにより近いfloat値 mathモジュール Python3 概要 インポート 実行結果 表示イメージ 概要nextafter(x, y) xからyに向かって近いfloatの値 mathモジュール インポート import math 実行結果 import math print(math.nextafter(0, math.inf)) print(math.nextafter(0, -math.inf)) print(math.nextafter(0, 0.0)) 表示イメージ 5e-324 -5e-324 0.0