Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: It is the same "gotcha" as
>>> math.cos(math.pi/2) 6.123233995736766e-17 You can expect that cos(π/2) is exactly 0, but floating point value math.pi is only an approximation of the π number. The difference between math.pi and exact value of π leads to non-zero result of cos(math.pi/2). ---------- nosy: +serhiy.storchaka _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue43830> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com