问题描述
>>来自math import *
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
余弦函数工作正常,但我正在为正弦得到奇怪的答案。
这是一个错误吗?我做错了吗?
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
余弦函数工作正常,但我正在为正弦得到奇怪的答案。
这是一个错误吗?难道我做错了什么?
你认为2.4版本的答案是什么?
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
余弦函数工作正常,但我得到了奇怪的答案
正弦。这是一个错误吗?我做错了吗?
描述
此模块始终可用。它提供了对C标准定义的
数学函数的访问。
所以你看到的是被暴露的C库的行为。 />
尝试sin(pi * 0.5)以查看与cos(pi)或cos(pi * 2)类似的行为。
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
$
余弦函数工作正常,但是我得到了奇怪的答案
正弦。这是一个错误吗?难道我做错了什么?
描述
此模块始终可用。它提供了对C标准定义的
数学函数的访问。
所以你看到的是被暴露的C库的行为。 />
尝试sin(pi * 0.5)以查看与cos(pi)或cos(pi * 2)类似的行为。
>>from math import *
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
The cosine function works fine, but I''m getting weird answers for sine.
Is this a bug? Am I doing something wrong?
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
The cosine function works fine, but I''m getting weird answers for sine.
Is this a bug? Am I doing something wrong?
What answer do you suppose you get in version 2.4?
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
The cosine function works fine, but I''m getting weird answers for
sine. Is this a bug? Am I doing something wrong?
DESCRIPTION
This module is always available. It provides access to the
mathematical functions defined by the C standard.
So what you are seeing is the behavior of the C library being exposed.
Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2).
0.0
1.2246063538223773e-016
-2.4492127076447545e-016
1.0
-1.0
1.0
The cosine function works fine, but I''m getting weird answers for
sine. Is this a bug? Am I doing something wrong?
DESCRIPTION
This module is always available. It provides access to the
mathematical functions defined by the C standard.
So what you are seeing is the behavior of the C library being exposed.
Try sin(pi*0.5) to see similar behavior to cos(pi) or cos(pi*2).
这篇关于2.5中'math'模块的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!