Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

(jeffa) Re: negative sqrt()

by jeffa (Bishop)
on Feb 09, 2002 at 15:48 UTC ( [id://144361]=note: print w/replies, xml ) Need Help??


in reply to negative sqrt()

$ perldoc -f sqrt

  sqrt EXPR
  sqrt    Return the square root of EXPR.  If EXPR is
          omitted, returns square root of "$_".  Only works
          on non-negative operands, unless you've loaded the
          standard Math::Complex module.

          use Math::Complex;
          print sqrt(-2);    # prints 1.4142135623731i

UPDATE:
But i didn't really answer the question, "why can't you 'catch' this exception" ... is it possible? Why yes it is! Fletch++!

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://144361]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-24 19:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found