comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » cubic root
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
cubic root [message #83966] Tue, 16 April 2013 08:08 Go to next message
fd_luni is currently offline  fd_luni
Messages: 66
Registered: January 2013
Member
Hi all

I have a question about cubic roots. The cubic roots of a negative number there exists. The cubir root of -1 is -1, 0f -2 is -1.25 and so on why when I typed in IDL to calculate the cubic root of a negative value it print out NaN which means Not a Number?

E.g. I typed: (-1)^1.0/3 and it prints out NaN

Is there any way to fixed it and don't get NaNs but get the actual value?

Best Wishes
Maria
Re: cubic root [message #84052 is a reply to message #83966] Fri, 26 April 2013 02:11 Go to previous messageGo to next message
fd_luni is currently offline  fd_luni
Messages: 66
Registered: January 2013
Member
I am using 6.4 version.
Yes you are write I have wrote it wrong.
IDL> print, (-1)^1.0/3
results in -0.33333 for me as well.
Re: cubic root [message #84073 is a reply to message #83966] Thu, 25 April 2013 10:40 Go to previous messageGo to next message
mairan.teodoro is currently offline  mairan.teodoro
Messages: 20
Registered: June 2008
Junior Member
Hi Maria,

One question, what version of IDL are you using?

I'm using 8.2 and, as Lajos mentioned, the command

IDL> print, (-1)^1.0/3

results in -0.33333 for me.

m.
Re: cubic root [message #84143 is a reply to message #84052] Fri, 26 April 2013 06:43 Go to previous message
mairan.teodoro is currently offline  mairan.teodoro
Messages: 20
Registered: June 2008
Junior Member
Hi Maria!

Great to know that you found the problem!

However, to find the cubic root you should use any of the suggestions given by the people in this thread.

Best regards,
m.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: nearest node of Delauny tesselation
Next Topic: How to calculate the slope of a line in a graph ?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:10:31 PDT 2025

Total time taken to generate the page: 0.00466 seconds