Python math module questions

Asked 2 years ago, Updated 2 years ago, 54 views

import math as m
#1, Result value: 1.0
print(m.sin(m.pi/2))
#2, result value -2.4492935982947064e-16
print(m.tan(m.pi*2))

If you do it like number 1, you will get the exact value of sin/2/2.

But I wonder why the approximate value comes out when you do it like #2, not tan 0.

Thank you for your reply. Have a great day!

python time

2022-09-20 08:57

1 Answers

When we say y = sin(x), what we want to know is that the value of the function The error is 입니다y.

To express the relationship between yy and xx, the error value of x,

yy/xx is the slope, so yy/xx = (sin(x)) = cos(x)

To summarize the expression,

Δy = cos(x) Δx


2022-09-20 08:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.