[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MOD operator



Hi experts.

I was wondering if the result of the MOD operator in IDL changed
from previous versions (4.x, 5.0) to the current version (5.3.1).
Now the output is:

IDL> PRINT, (FINDGEN(8)-4.) MOD 3
     -1.00000     0.000000     -2.00000     -1.00000     0.000000
      1.00000      2.00000     0.000000

When I programmed a function long ago I used the MOD operator 
expecting the output  

IDL> PRINT, (FINDGEN(8)-4.) MOD 3
      2.00000     0.000000      1.00000      2.00000     0.000000      
      1.00000      2.00000     0.000000

I used MOD to get rid number lower than zero and higher than 
23.999999 when calculating the hours of the day for example.

Any help or tests with old versions are appreciated. Thanks

Theo


-- 
----------------------------------------------
Dr. Theo Brauers
Institut fuer Atmosphaerische Chemie (ICG-3)
Forschungszentrum Juelich
52425 JUELICH, Germany
Tel. +49-2461-61-6646    Fax. +49-2461-61-5346
http://www.kfa-juelich.de/icg/icg3/MITARBEITER/th.brauers.html