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

Home » Public Forums » archive » Re: Need Math Instruction
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: Need Math Instruction [message #83436] Wed, 06 March 2013 20:52 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
Is it -4*arec or -4*arec*crec?

-Jeremy.


On 3/6/13 7:22 PM, David Fanning wrote:
> Folks,
>
> I need some help with a math problem. Here are some values and an
> expression. The result of the expression is a NaN.
>
> arec= 7.0380332e-005
> brec= 0.011374851
> crec= 0.010008938
> drec= 3.8378659e-005
> Tprec = (brec-(brec^2 -4*arec)^(1.0/2))/(2*arec)
>
> IDL> help, Tprec
> TPREC FLOAT = -NaN
>
> I want to know why this is a NaN and how to explain the following
> results:
>
> IDL> help, brec, arec
> BREC FLOAT = 0.0113749
> AREC FLOAT = 7.03803e-005
>
> IDL> print, (brec^2 -4*arec)
> -0.000152134
> IDL> d = (brec^2 -4*arec)
> IDL> help, d
> D FLOAT = -0.000152134
>
> IDL> print, d^(1.0/2)
> -NaN
>
> IDL> print, -0.000152134^(1.0/2)
> -0.0123343
>
> IDL> print, d, format='(F0.12)'
> -0.000152134089
>
> IDL> print, -0.000152134089D^(1.0/2)
> -0.012334265
>
> IDL> print, Float(-0.0001521340891486)^(1.0/2)
> -NaN
>
> IDL> print, -0.0001521340891486^(1.0/2)
> -0.0123343
>
> IDL> print, Double(-0.0001521340891486D)^(1.0/2)
> -NaN
>
> IDL> print, -0.0001521340891486D^(1.0/2)
> -0.012334265
>
> Any ideas?
>
> Thanks,
>
> David
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Grid lines misaligned when using CONTOUR and MAP_SET
Next Topic: Need Math Instruction

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

Current Time: Wed Oct 08 16:07:13 PDT 2025

Total time taken to generate the page: 0.00457 seconds