[SciPy-dev] tanh(j*pi/2)
David Goldsmith
d_l_goldsmith@yahoo....
Wed Jun 10 00:06:12 CDT 2009
Understood, thanks. Just curious: can N.allclose be used w/ N.inf, or does one need to reciprocate first?
DG
--- On Tue, 6/9/09, Robert Kern <robert.kern@gmail.com> wrote:
> From: Robert Kern <robert.kern@gmail.com>
> Subject: Re: [SciPy-dev] tanh(j*pi/2)
> To: d_l_goldsmith@yahoo.com, "SciPy Developers List" <scipy-dev@scipy.org>
> Date: Tuesday, June 9, 2009, 9:56 PM
> 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
>
More information about the Scipy-dev
mailing list