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

Home » Public Forums » archive » Cubic root finding on a grid
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: cubic root [message #83963 is a reply to message #68737] Tue, 16 April 2013 08:27 Go to previous messageGo to previous message
wlandsman is currently offline  wlandsman
Messages: 743
Registered: June 2000
Senior Member
You can also use FZ_ROOTS to get all 3 roots to the equation x^3 + 1 = 0

IDL> print,fz_roots([1,0d,0,1.0d])
( -1.0000000, 0.0000000)( 0.50000000, -0.86602540)( 0.50000000, 0.86602540)

or use http://idlastro.gsfc.nasa.gov/ftp/contrib/freudenreich/cuber oot.pro

On Tuesday, April 16, 2013 11:08:12 AM UTC-4, fd_...@mail.com wrote:
> 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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Finding distance with longitude and latitude
Next Topic: All logical unit currently in use

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

Current Time: Fri Oct 10 14:17:46 PDT 2025

Total time taken to generate the page: 0.23931 seconds