develooper Front page | perl.perl5.porters | Postings from August 2001

Re: inf handling in Perl incomplete

Thread Previous | Thread Next
From:
Jarkko Hietaniemi
Date:
August 10, 2001 14:59
Subject:
Re: inf handling in Perl incomplete
Message ID:
20010810165830.B20736@chaos.wustl.edu
On Fri, Aug 10, 2001 at 02:53:54PM -0700, Steve Fink wrote:
> On Fri, 10 Aug 2001, Abigail wrote:
> 
> > On Fri, Aug 10, 2001 at 10:46:38AM -0700, Steve Fink wrote:
> > > > > P.S.  Pssst, you certain you don't want sqrt(-1) returning 'i'? :-)
> > > 
> > > Sure; I want to see what you make sqrt(sqrt(-1)) return -- in scalar
> > > context. :-)
> > 
> > 
> >     Math::Complex -> emake (1, pi/8)
> 
> You mean pi/4, but I get the point. And reading the Math::Complex
> documentation, I get my answer -- it just picks one; if you want both, you
> use root(). Hmf. Seems like a cop-out.

Wrong.  A conscious design decision.  You don't want

	print "foo = ", sqrt($a), "\n";

printing e.g.

	foo = i-i

> Perhaps the real answer is use
> Quantum::Superpositions; any(root(i))?

-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About