「計算機イプシロン」の版間の差分
imported>Administrator |
imported>Administrator 編集の要約なし |
||
| 22行目: | 22行目: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Python === | |||
Pythonでの実装例。 | |||
<syntaxhighlight lang="python"> | |||
a = 1.0 | |||
b = 0.0 | |||
while 0 < a : | |||
b = a | |||
a = a / 2.0 | |||
print("{0:09.8E}".format(b)) | |||
</syntaxhighlight> | |||
== 関連項目 == | == 関連項目 == | ||
* [[.NETのfloat.Epsilon定数は計算機イプシロンではない]] | * [[.NETのfloat.Epsilon定数は計算機イプシロンではない]] | ||