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

Home » Public Forums » archive » Re: subtle but important
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: subtle but important [message #24908] Fri, 27 April 2001 09:12 Go to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
Craig Markwardt wrote:
>
> Randall Skelton <rhskelto@atm.ox.ac.uk> writes:
>> On Fri, 27 Apr 2001, Liam E. Gumley wrote:
>>
>>> This is a subtle but important point. DOUBLE() is a type conversion
>>> function [snip]
>>
>> While we are on the subject of 'subtle but important points' in IDL...
>>
>> I also learned today that for integers the default length is 16-bit unless
>> you use the "COMPILE_OPT DEFINT32" statement. Try "print, 1000*1000" in
>> IDL.
>
> Appending "L" to integers saves a lot of grief later on.

This is an understatement

Maybe it's my fortran background, but I always stick an "L" on the end of integers so I
know (and others who read the code after me) that this value is a LONG (read: 4 byte)
integer, even for silly stuff like

n = 3L
FOR i = 0L, n - 1L DO BEGIN
.....
ENDFOR

In this case there's no need but one day someone might make "n" greater than what a 2-byte
int can hold.

Don't they teach this sort of stuff (and the floating point representation stuff) in
computing/science courses anymore?

paulv

--
Paul van Delst A little learning is a dangerous thing;
CIMSS @ NOAA/NCEP Drink deep, or taste not the Pierian spring;
Ph: (301)763-8000 x7274 There shallow draughts intoxicate the brain,
Fax:(301)763-8545 And drinking largely sobers us again.
paul.vandelst@noaa.gov Alexander Pope.
[Message index]
 
Read Message
Read Message
Previous Topic: Re: 2 variables on same plot?
Next Topic: Incrementing an Array

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

Current Time: Fri Oct 10 18:58:13 PDT 2025

Total time taken to generate the page: 0.72218 seconds