XTCE 1.2 RTF Avatar
  1. OMG Issue

XTCE12 — MathOperator needs to be cleaned up

  • Key: XTCE12-124
  • Legacy Issue Number: 14467
  • Status: closed  
  • Source: NASA ( Mr. James Kevin Rice)
  • Summary:

    Description Kevin Rice 2007-10-22 21:38:51 BST
    MathOperators "^" should either be removed or expanded to include all bitwise
    operators, add or remove operators in math operators.

  • Reported: XTCE 1.1 — Thu, 17 Sep 2009 04:00 GMT
  • Disposition: Resolved — XTCE 1.2
  • Disposition Summary:

    Add annotation and additional operators

    Propose to update the type MathOperatorsType with documentation, add additional operators and correct ThisParameterOperandType.

    Replace the existing simpleType MathOperatorsType with the following new simpleType, containing documentation
    for all operators and the new operators: drop, dup, over.

    <simpleType name="MathOperatorsType">
    <annotation>
    <documentation>Mathematical operators used in the math operation. Behavior of each operator on the stack is described using notation (before – after), where "before" represents the stack before execution of the operator and "after" represent the stack after execution.</documentation>
    </annotation>
    <restriction base="string">
    <enumeration value="+">
    <annotation>
    <documentation>addition (x1 x2 – x1+x2)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="-">
    <annotation>
    <documentation>subtraction (x1 x2 – x1-x2)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="*">
    <annotation>
    <documentation>multiplication (x1 x2 – x1*x2)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="/">
    <annotation>
    <documentation>division (x1 x2 – x1/x2) An undefined condition exists if x2 is zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="%">
    <annotation>
    <documentation>unsigned mod (x1 x2 – x3) Divide x1 by x2, giving the remainder x3; an undefined condition exists if x2 is zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="^">
    <annotation>
    <documentation>power function (x1 x2 – x1**x2)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="y^x">
    <annotation>
    <documentation>reverse power function (x1 x2 – x2**x1)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="ln"/>
    <annotation>
    <documentation>natural (base e) logarithm (x – ln(x)) An undefined condition exists if x is less than or equal to zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="log"/>
    <annotation>
    <documentation>base-10 logarithm (x-- log(x)) An undefined condition exists if x is less than or equal to zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="e^x">
    <annotation>
    <documentation>exponentiation (x – exp(x))</documentation>
    </annotation>
    </enumeration>
    <enumeration value="1/x">
    <annotation>
    <documentation>inversion (x – 1/x) An undefined condition exists if x is zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="x!">
    <annotation>
    <documentation>factorial (x – x!) An undefined condition exists if x is less than zero</documentation>
    </annotation>
    </enumeration>
    <enumeration value="tan">
    <annotation>
    <documentation>tangent (x – tan(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="cos">
    <annotation>
    <documentation>cosine (x – cos(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="sin">
    <annotation>
    <documentation>sine (x – sin(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="atan">
    <annotation>
    <documentation>arctangent (x – atan(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="acos">
    <annotation>
    <documentation>arccosine (x – acos(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="asin">
    <annotation>
    <documentation>arcsine (x – asin(x)) radians</documentation>
    </annotation>
    </enumeration>
    <enumeration value="tanh">
    <annotation>
    <documentation>hyperbolic tangent (x – tanh(x))</documentation>
    </annotation>
    </enumeration>
    <enumeration value="cosh">
    <annotation>
    <documentation>hyperbolic cosine (x – cosh(x))</documentation>
    </annotation>
    </enumeration>
    <enumeration value="sinh">
    <annotation>
    <documentation>hyperbolic sine (x – sinh(x))</documentation>
    </annotation>
    </enumeration>
    <enumeration value="atanh">
    <annotation>
    <documentation>hyperbolic arctangent (x – atanh(x)) An undefined condition exists if x is outside the range [-1.0,+1.0]</documentation>
    </annotation>
    </enumeration>
    <enumeration value="acosh">
    <annotation>
    <documentation>hyperbolic arccosine (x – acosh(x)) An undefined condition exists if n is less than one</documentation>
    </annotation>
    </enumeration>
    <enumeration value="asinh">
    <annotation>
    <documentation>hyperbolic arcsine (x – asinh(x)) </documentation>
    </annotation>
    </enumeration>
    <enumeration value="swap">
    <annotation>
    <documentation>swap the top two stack items (x1 x2 – x2 x1)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="drop">
    <annotation>
    <documentation>Remove top item from the stack (x – )</documentation>
    </annotation>
    </enumeration>
    <enumeration value="dup">
    <annotation>
    <documentation>Duplicate top item on the stack (x – x x)</documentation>
    </annotation>
    </enumeration>
    <enumeration value="over">
    <annotation>
    <documentation>Duplicate top item on the stack (x1 x2 – x1 x2 x1)</documentation>
    </annotation>
    </enumeration>
    </restriction>
    </simpleType>

    A mistake was introduced in a previous issue resolution. A new attribute was added to the ThisParameterOperand element in the complexType MathOperationType. The new attribute allows the specification of the calibrated or the uncalibrated value. This is nonsensical because the value of "this parameter" is not yet calibrated, which is why the calibrator is being evaluated.
    To resolve this, remove the extra attribute added and restore the type of the element to the more simple "string".
    <element name="ThisParameterOperand" type="string">
    <annotation>
    <documentation xml:lang="en">This element is a shortcut to represent the current parameter for which this math operation applies. It is shorter than using the ParameterInstanceRefOperand, which can also specify this current parameter, but in a longer form syntax.</documentation>
    </annotation>
    </element>

  • Updated: Tue, 10 Jul 2018 14:22 GMT