Re: errata/282: signing

From: Shalom.Bresticker@motorola.com
Date: Sat May 01 2004 - 12:13:19 PDT

  • Next message: Alec Stanculescu: "Re: errata/282: signing"

    > The precedent providing the answer to this question is present in
    > 4.1.5 Arithmetic operators (just a few paragraphs before the debated
    > use of the word "expression").

    Alec,

    Are you confusing between 4.1.5 and 4.5.1 ?

    > 4.1.5 deals with the specific details of how the type of the
    > expression is determined, and which states among other things
    > that:
    >
    > "....
    > The result of the power operator shall be real if either operand is a
    > real, integer, or signed. If both operands are unsigned then the
    > result shall be unsigned.
    > ..."
    >
    > It is clear (because of the use of the word "both") that the type of
    > the power-operator-expression depends only on the type of the operands
    > of this particular operator and not on the operands present in a
    > complex expression which may include the power operator as a
    > subexpression. Also, I cannot imagine how it would be if the type of
    > the power operator expression would depend on the operand on some
    > other expression included in the same overall complex expression.

    You picked a bad example for several reasons.

    One is that the text you quoted is from 1364-2001 Version B and is simply
    incorrect. That was errata issue #140. The text was completely rewritten
    and substantially changed.

    The second reason is that, yes, the type of the first operand of the power
    operator (i.e., the base) is affected by the other operands in the expression
    in which it appears, i.e., it's bit-size and signedness.
    (The second operand, the power, is self-determined, and not affected by other
    operands.)

    Thirdly, the text refers only to the two operands of this operator in order to
    not complicate the text further by talking about additional operands.
    Similarly, 4.1.7, for example, says that "When two operands of unequal bit
    lengths are used ..., the smaller operand shall be zero filled ... to extend
    to the size of the larger operand," and does not relate to other operands in
    the larger expression. And the same is true of the other subsections of 4.1.

    Shalom



    This archive was generated by hypermail 2.1.4 : Sat May 01 2004 - 11:53:56 PDT and
    sponsored by Boyd Technology, Inc.