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

Home » Public Forums » archive » Re: Yet again, The Sky is Falling!
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: Yet again, The Sky is Falling! [message #52840] Fri, 09 March 2007 01:25 Go to previous message
Paolo Grigis is currently offline  Paolo Grigis
Messages: 171
Registered: December 2003
Senior Member
Here's a simple example of a routine that returns different
values if it is called by value or by reference.

pro pg,a,b

b=arg_present(a)

end


IDL> x=1
IDL> pg,x,b
IDL> print,b
1

IDL> pg,x+0,b
IDL> print,b
0

IDL> pg,x[0],b
IDL> print,b
0


Ciao,
Paolo


David Fanning wrote:
> yp writes:
>
>> You can download the code from www.research.plymouth.ac.uk/casix/temp/test_morel_LUT.pro
>>
>> You will also need the LUT (morel_fq.dat) to run the code.
>> www.research.plymouth.ac.uk/casix/temp/MOREL_FQ.DAT
>
> Well, I haven't tracked the actual culprit down yet, but
> the calculations in INT_LUT are doing *something* to the
> variables that are being passed in by reference. If I
> pass everything in by value, then there is no difference:
>
>
> IDL> int_LUT,412.5D, 1D, 0.0D, 0.0D, 0.0D, 0.03D, result3
> IDL> int_LUT,412.5D+0, 1D+0, nul+0, nul+0, nul+0, 0.03D+0, result4
> IDL> print,'RESULT 3: ', result3[*]
> IDL> print,'RESULT 4: ', result4[*]
>
> RESULT 3: 0.090100000 0.00000000 0.00000000
> 0.00000000 0.00000000 0.00000000 0.00000000
>
> RESULT 4: 0.090100000 0.00000000 0.00000000
> 0.00000000 0.00000000 0.00000000 0.00000000
>
> I suspect there is a calculation in there that sets one
> of the values very nearly to what you expect it to be,
> but not quite.
>
> Still weird, but more believable. :-)
>
> Cheers,
>
> David
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Array resize with arbitrary arithmetic
Next Topic: mpeg creation problem

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

Current Time: Fri Oct 10 04:41:08 PDT 2025

Total time taken to generate the page: 0.88124 seconds