LoginSignup
2
2

More than 5 years have passed since last update.

pythonでハマった落とし穴をまとめる記事

Posted at

分数

NG:

def F(z, tau):
    return z + 1 / 2 * np.sin(2 * z) - pi / 2 * tau

OK:

def F(z, tau):
    return z + 1. / 2. * np.sin(2 * z) - pi / 2 * tau

Cでもpythonでもrubyでも1/2は0です。JSerやPHPerは泣かない

2
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2