Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!jato!vsnyder From: vsnyder@jato.jpl.nasa.gov (Van Snyder) Newsgroups: comp.lang.fortran Subject: Re: Fortran 90 status Message-ID: <1991May21.203019.21452@jato.jpl.nasa.gov> Date: 21 May 91 20:30:19 GMT Reply-To: vsnyder@jato.Jpl.Nasa.Gov (Van Snyder) Distribution: comp Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 55 I tried for several years to get X3J3 to extend CASE to include REAL ranges. I explained carefully that this was nothing different from IF...ELSE IF ... ELSE IF ... ELSE ... END IF, but that the part of the predicate repeated in each ELSE IF was put into the SELECT CASE statement instead. All I got by way of explanation for failure to extend CASE was that: 1. "Real relationals were a mistake in Fortran 77 that we didn't want to repeat." 2. "Real induction variables in DO in Fortran 77 were a mistake that we didn't want to repeat." 3. "Real subscripts ... " 4. "There will be non-portable round-off problems." 5. "There WILL be non-portable round-off problems." Nobody explained any of these. How can allowing a programmer to write a clearer, more optimized version of IF ... ELSE IF ... ELSE IF ... ELSE block cause any of the above problems? BTW, the attraction of Arithmetic IF is that it does a little bit of what extending CASE to REAL ranges would allow. The alternative to IF (e) 10,20,30 SHOULD have been SELECT CASE e CASE * < 0 blah blah (statement 10ff above) CASE * = 0 blah blah (statement 20ff above) CASE * > 0 ! or DEFAULT blah blah (statement 30ff above) END CASE instead of IF (e.lt.0) THEN blah blah 10 ELSE IF (e.eq.0) THEN blah blah 20 ELSE blah blah 30 END IF which requires "e" to be evaluated twice, or the almost as repulsive temp = e IF (temp.lt.0) THEN ... Where does the non-portable round-off creep in? That is, the non-portable round-off in CASE that's different from the non-portable round-off in the equivalent sequence of IF ... ELSE IF ... -- vsnyder@jato.Jpl.Nasa.Gov ames!elroy!jato!vsnyder vsnyder@jato.uucp