in reply to Re^2: root function
in thread root function
sini@ordinalfabetix:~$ perl -le"print ((-3)**(1/3));" nan sini@ordinalfabetix:~$
Exponent operator ** has higher priority than unary minus so you are doing -(3**(1/3)) instead of ((-3)**(1/3)).
This gives you accidentally the right result but it would tell you that square root of -2 == -1.414265...
Careful with that hash Eugene.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: root function
by ikegami (Patriarch) on Jun 21, 2008 at 21:58 UTC | |
by sasdrtx (Friar) on Jun 21, 2008 at 23:17 UTC | |
by psini (Deacon) on Jun 21, 2008 at 22:03 UTC |