Skip to content

Instantly share code, notes, and snippets.

@sor4chi
Last active October 27, 2021 16:37
Show Gist options
  • Select an option

  • Save sor4chi/d294c157a584684854908d9cd9a242a0 to your computer and use it in GitHub Desktop.

Select an option

Save sor4chi/d294c157a584684854908d9cd9a242a0 to your computer and use it in GitHub Desktop.
情報システム工学入門_04 レポート課題1回答
x = [0.13, 0.13 + 10 ** -10]
dif_1 = abs(x[0]-x[1])
dif = 0
counter = 0
while (dif < dif_1 * 1000):
counter += 1
for i,value in enumerate(x):
x[i] = 2*value if value < 0.5 else -2*value + 2
dif = abs(x[0]-x[1])
print(counter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment