Version 1.1 of acs/ac-00196.txt

Unformatted version of acs/ac-00196.txt version 1.1
Other versions for file acs/ac-00196.txt

!standard A.5.1(15)          10-10-20 AC95-00196/01
!standard A.5.1(45)
!class confirmation 10-10-20
!status received no action 10-10-20
!status received 10-03-04
!subject Problems with A.5.1 language

!topic Problems with A.5.1 language
!reference A.5.1
!from Adam Beneschan 10-03-04

I'm looking over A.5.1, and it looks to me like there are some passages that aren't really appropriate in an Ada standard.  I'm guessing that some of this language was lifted from IEC559:1989 with little or no modification, but probably ought to be reworke
d a bit.

A.5.1(15): "The results of the Artcan and Arccot functions are in the quadrant
containing the point (x, y), where x and y are the values of the parameters X
and Y, respectively.  This may be any quadrant (I through IV) when the parameter
X (resp., Y) of Arctan (resp., Arccot) is specified, but it is restricted to
quadrants I and IV (resp., I and II) when that parameter is omitted....."

My problem with this is that Arctan and Arccot (without the Cycle
parameters) are declared like this:

   function Arctan (Y : Float_Type'Base;
                    X : Float_Type'Base := 1.0);
   function Arccot (X : Float_Type'Base;
                    Y : Float_Type'Base := 1.0);

In Ada, when a parameter has a default value, calling the subprogram with an
omitted parameter is, semantically, exactly the same as calling it with the
default value of the parameter.  So to me, it really doesn't make any sense to
speak as if the behavior of such a function were different depending on whether
a parameter is specified or omitted.  It might make sense when talking about
Fortran, which (if I recall correctly) has separate routines arctan(x) and
arctan2(y,x). And this is probably true for other languages as well.  But I
don't think the language is appropriate for Ada.

It happens to be *true*, I think---i.e. if the X parameter to arctan has the
default value (or any positive value, for that matter), the result will be in
quadrant I or IV.  But I still think this paragraph should be reworded without
any reference to whether a parameter is "omitted".  After all, in Ada, it never
really is omitted.

A.5.1(45): "A prescribed zero result delivered _at the origin_ by one of the odd
functions (Sin, Arcsin, Sinh, Arcsinh, Tan, Arctan, or Arccot as a function of Y
when X is fixed and positive, Tanh, and Arctanh) has the sign of the parameter X
(Y, in the case of Arctan or Arccot)."

First of all, if "at the origin" just means that the argument is zero (the first
argument, in the case or Arctan), wouldn't it be better just to say so?  (Also,
what does it mean for Arccot?)  If it means something else, what does it mean?

Second, the reference to "Arccot as a function of Y when X is fixed and
positive" doesn't make sense.  Parameters in Ada have values, but they don't
have properties like "being fixed".  So that language doesn't particularly make
sense.  (I'm not really sure it makes sense in any computer language.)

I propose that this paragraph be reworded to just say what it means, like
A.5.1(38).  "If Sin, Arcsin, Sinh, Arcsinh, Tan, Tanh, or Arctanh is called with
zero as its parameter, the result has the same sign as the parameter."
Similarly for Arctan if Y is zero, and for Arccot when Y is zero and X is
positive (the result has the same sign as Y)---assuming I have the intent


Considered insufficiently broken. Ed Schonberg said: "Adam is technically right,
but this is make-work, the text is perfectly correct, albeit redundant."


Questions? Ask the ACAA Technical Agent