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

Home » Public Forums » archive » Re: Problem with variable declaration
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: Problem with variable declaration [message #70524 is a reply to message #70523] Wed, 21 April 2010 10:31 Go to previous messageGo to previous message
jeanh is currently offline  jeanh
Messages: 79
Registered: November 2009
Member
On 21/04/2010 1:24 PM, bala murugan wrote:
> 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

be careful of your data type.
10^5 will not work, as the result is an integer... but its intended
value is too big for an integer!


IDL> help,(10^5)
<Expression> INT = -31072

So you can compute this with double precision

IDL> help,(10D^5)
<Expression> DOUBLE = 100000.00


IDL> print,((10^5)/(exp(10)*factorial(5)))
-0.011755555
IDL> print,((10D^5)/(exp(10)*factorial(5)))
0.037833276


Jean
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Arc of a circle
Next Topic: Problem with variable declaration

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

Current Time: Sat Oct 11 01:42:48 PDT 2025

Total time taken to generate the page: 0.40218 seconds