June 10, 2009
4:51 a.m.
import numpy as N N.tanh(N.pi*1j/2) 16331778728383844j
Is this the desired behavior? (I.e., why doesn't this return N.inf or N.nan?) DG
June 10, 2009
4:56 a.m.
New subject: [SciPy-dev] tanh(j*pi/2)
On Tue, Jun 9, 2009 at 23:51, <d_l_goldsmith@yahoo.com> wrote:
import numpy as N N.tanh(N.pi*1j/2) 16331778728383844j
Is this the desired behavior?
It's what floating point arithmetic gives us. N.pi/2 is not precisely the real number pi/2 so cos(N.pi/2) is not precisely 0 so 2/cos(N.pi/2) is not inf or nan. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
6296
Age (days ago)
6296
Last active (days ago)
1 comments
2 participants
participants (2)
-
d_l_goldsmith@yahoo.com -
Robert Kern