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

Home » Public Forums » archive » Problem with variable declaration
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
Problem with variable declaration [message #70526] Wed, 21 April 2010 10:24 Go to next message
bala murugan is currently offline  bala murugan
Messages: 23
Registered: April 2010
Junior Member
Hi guys,

IDL> print,((10^5)/(exp(10)*factorial(5)))

The actual result of the above line is 0.0378332748

But when we run it in IDL we get the result as -0.011755556

What should be done to rectify this?

Thanks,
B
Re: Problem with variable declaration [message #70616 is a reply to message #70526] Wed, 21 April 2010 11:04 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
pp writes:

> That is a conversion, not a declaration. In the case you mentioned
> above, you can declare as
>
> u=10d0 & x=5d0

Right. And be *sure* you understand the difference. It
matters. :-)

http://www.dfanning.com/math_tips/double.html

Cheers,

David


--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Problem with variable declaration
Next Topic: Declaring large vectors in IDL

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

Current Time: Wed Oct 08 11:34:24 PDT 2025

Total time taken to generate the page: 0.00551 seconds