Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Migration Guide

Math built-ins

The new compiler invokes the Language Environment-provided routines to evaluate the mathematical built-in functions (such as SIN or COS) and for float exponentiation. These routines are more precise than the routines provided with the OS PL/I V2R3 library and can sometimes produce results with a different last digit.

As an example of this difference, consider the following program which produces the kind of table seen at the back of trigonometric textbooks:

    trigtab: proc options(main);

      dcl degrees   fixed dec(5,1);
      dcl minutes   fixed dec(3,1);

      do degrees = 0 to 359;
        put skip edit( degrees ) ( f(5) );
        do minutes = 0 to .9 by .1;
          put edit( sind(degrees+minutes) ) ( f(9,4) );
        end;
      end;

    end;

The output of this program looks like:

       0   0.0000   0.0017   0.0035   0.0052   0.0070   ...
       1   0.0175   0.0192   0.0209   0.0227   0.0244   ...

The table produced depends on which math library is used, and even then there are only 5 different values. For instance, with the old compilers using the pre-LE math library, the result for 140.1 is 0.6414, while with the old compilers using the Language Environment math library, the result is 0.6415. Since the new compiler uses only the Language Environment math library, the result with it is also 0.6415.


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)