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 #70522 is a reply to message #70521] Wed, 21 April 2010 10:34 Go to previous messageGo to previous message
bala murugan is currently offline  bala murugan
Messages: 23
Registered: April 2010
Junior Member
On Apr 21, 11:31 am, jeanh
<jghasb...@DELETETHIS.environmentalmodelers.ANDTHIS.com> wrote:
> 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

Thanks a lot Jean. But when I am using an expression like the
following,

a = (u^x)/(exp(u)*factorial(x))

where u=10 & x = 5

What do I do in this case?
[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: Wed Oct 08 19:33:21 PDT 2025

Total time taken to generate the page: 0.00396 seconds