Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: Floating point system variables on RS6000
Ken, One good reason is that IDL variables change their type "on the fly." If !PI or any of the others were double precision, the double precision math would propagate throughout the program. Those of us who do single precision calculations would have to FLOAT(!PI) to keep our programs single precision and fast. Joseph M. Zawodny (KO4LW) NASA Langley Research Center zawodny@arbd0.larc.nasa.gov MS-475, Hampton VA, 23681
In article <1et89fINNlkn@rave.larc.nasa.gov>, zawodny@arbd0.larc.nasa.gov (Dr. Joseph M Zawodny) wrote: > > Ken, > > One good reason is that IDL variables change their type "on the fly." > If !PI or any of the others were double precision, the double precision math > would propagate throughout the program. Those of us who do single precision > calculations would have to FLOAT(!PI) to keep our programs single precision and > fast. I understand this is true on most machines, but on the RS6000 double precision is usually faster than single precision, because all single precision values must be converted to double precision for the floating point unit and then converted back. In some circumstances, double precision is slower because the cache size is effectively reduced to half as large. So _memory_ may be a problem if intermediate results are stored in double precision, but (on the RS6000) _speed_ is generally not a problem when working in double precision. Since there is a !DPI system variable, how about a !DDTOR and !DRADDEG? (It's OK, I'll just make one myself. Like I do in Fortran. ;-) )