-- GCEF spec -- Question: I like Jan Kok's rationale for the selection of which generic -- formal parameters are needed: There are enough selectors -- to decompose input parameters of functions into real values -- and there are enough constructors to produce the required -- outputs of type COMPLEX. Thus, persons having a complete set -- of algorithms that compute the real and imaginary components -- of the complex functions, using only real arithmetic, have -- everything they need. -- Short names, REAL, COMPLEX, IMAGINARY seem to be preferred. -- Any suggested changes? Jon with ELEMENTARY_FUNCTIONS_EXCEPTIONS; generic type REAL is digits <>; type COMPLEX is private; type IMAGINARY is private; with function RE (X : COMPLEX) return REAL is <>; with function IM (X : COMPLEX) return REAL is <>; with function IM (X : IMAGINARY) return REAL is <>; with function COMPOSE_FROM_CARTESIAN (RE : REAL) return COMPLEX is <>; with function COMPOSE_FROM_CARTESIAN (RE, IM : REAL) return COMPLEX is <>; package GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS is function SQRT (X : COMPLEX) return COMPLEX; function LOG (X : COMPLEX) return COMPLEX; function EXP (X : COMPLEX) return COMPLEX; function EXP (X : IMAGINARY) return COMPLEX; function "**" (LEFT, RIGHT : COMPLEX) return COMPLEX; function "**" (LEFT : COMPLEX; RIGHT : REAL) return COMPLEX; function "**" (LEFT : REAL; RIGHT : COMPLEX) return COMPLEX; function SIN (X : COMPLEX) return COMPLEX; function COS (X : COMPLEX) return COMPLEX; function TAN (X : COMPLEX) return COMPLEX; function COT (X : COMPLEX) return COMPLEX; function ARCSIN (X : COMPLEX) return COMPLEX; function ARCCOS (X : COMPLEX) return COMPLEX; function ARCTAN (X : COMPLEX) return COMPLEX; function ARCCOT (X : COMPLEX) return COMPLEX; function SINH (X : COMPLEX) return COMPLEX; function COSH (X : COMPLEX) return COMPLEX; function TANH (X : COMPLEX) return COMPLEX; function COTH (X : COMPLEX) return COMPLEX; function ARCSINH (X : COMPLEX) return COMPLEX; function ARCCOSH (X : COMPLEX) return COMPLEX; function ARCTANH (X : COMPLEX) return COMPLEX; function ARCCOTH (X : COMPLEX) return COMPLEX; -- EXCEPTIONS -- ARGUMENT_ERROR : exception renames ELEMENTARY_FUNCTIONS_EXCEPTIONS.ARGUMENT_ERROR; end GENERIC_COMPLEX_ELEMENTARY_FUNCTIONS;