conforming vs non-conforming; IEEE vs Fortran

Tim Peters uunet!ksr!tim
Mon Jun 11 15:01:05 PDT 1990


>  [david hough]
>  My point was that programs that rely on IEEE features implicitly are just
>  as conforming as any others - and programs that rely on functions in an
>  external library are just as conforming as any others.

You seem to be trying to equate "reliance on IEEE features" with
"reliance on an external library"; I don't buy it on either technical
or practical grounds:

1) Technically, reliance on external procedures (whether vendor-
   supplied or not, whether written in Fortran or not) is explicitly
   conforming via the last paragraph of the section referenced in my msg
   (section 1.4); surely you don't read that section as also granting
   explicit conformance to programs relying on IEEE features (except, of
   course, on those provided via external calls)?

2) Practically, a program that relies on external procedures is likely
   much easier to port among all Fortran platforms than is a program
   that relies on IEEE features (just "easier" because you'll note
   Fortran doesn't guarantee that even conforming programs are portable
   -- "non-conforming program" is not a pejorative in Fortran, it's just
   a helpful admission that the program is likely to be *unusually*
   painful to port across the space of all Fortran implementations).

>  Non-conformity would arise in a program that exploited vendor-
>  supplied language features.

While that's one way to write a non-conforming program, conformance in
Fortran goes deeper than syntax.  In (section 1.4 lines 17-20)

   An executable program conforms to this std
   if it uses only those forms and relationships described herein
   and
   if the executable program has an interpretation according to this std

only the first half has to do with syntax.  E.g., the second half
renders the syntactically unobjectionable

...
      REAL X, Y, Z
...
      X = Y / Z
...

non-conforming whenever Z happens to be 0., because section 6.6 pg 6-15
line 50 specifically refuses to establish an interpretation for division
by 0.  As always a processor is free to establish its own interpretation
(and an IEEE-extended Fortran should!), but any program that *uses* that
extension (note that not all "extensions" are syntactic!) is non-
conforming; & that's as it should be so long as some Fortran platforms
decline to play it 754's way.

It's a more interesting question whether a program that relies on, e.g.,
6./3. coming out to exactly 2. is technically non-conforming or is just
non-portable because of section 1.3.2's point 6, but if anyone wants to
argue that let's refer to the std instead of "common sense" <grin>.

not-meaning-to-suggest-that-stds-aren't-the-pure-embodiment-of-common-
   sense-ly y'rs  - tim

Tim Peters   Kendall Square Research Corp
timaksr.com,  ksr!timaharvard.harvard.edu



More information about the Numeric-interest mailing list