Python cos(90) and cos(270) not 0

Indeed, it is a very low number, awfully close to zero. Here’s a great article which can help you understand the common challenges and pitfalls of floats: “What Every Computer Scientist Should Know About Floating-Point Arithmetic

Leave a Comment