Re: [sv-bc] Operators for use on real expressions

From: Geoffrey.Coram <geoffrey.coram_at_.....>
Date: Tue Aug 28 2007 - 05:08:23 PDT
I agree that 11-2 and 11-3 are now redundant.

(Should the mantis summary be changed to reference Clause 11 instead of 8?)

The sentence before 11-3:
   The result of using logical or relational operators on real numbers
   shall be a single-bit scalar value.
needs to be re-connected with the sentence afterwards:
   If any operand, except before the ? in the ternary operator, is real,
   the result is real. Otherwise, if any operand, except before the ? in
   the ternary operator, is shortreal, the result is shortreal.

Does this second sentence only apply to the ternary operator?  (The
table now calls it the "conditional_operator")  Should it be "either"
or "any"?  What is the type of this expression, when y is real?
    (y > 0) ? ((y == 1)||(y==2)) : (y<-1)

a) real, because "any operand" is real
b) single-bit scalar, since the operands of ?: are really
     ((y == 1)||(y==2))
    and
     (y<-1)
both of which are single-bit scalars

I think (b), so I'd re-word the sentence as:
   The result of the conditional operator operator is real if
   either operand after the ? is real.


It also seems that the logical operators (! && ||) could be used on other
data types, insofar as one can have
   if (expression)
and expression doesn't appear to have any semantic restrictions on its
type in 12.4.  That is,
   if (!expression)
should be just as valid for any expression.

-Geoffrey


Bresticker, Shalom wrote:
> Hi,
> 
> I am working on Mantis 1035, on some mistakes in Table 11-1 (Operators 
> and data types).
> 
> Relative to 1364, this version of the table adds the data types each 
> operator listed can be used for.
> 
> If so, it seems to me that Tables 11-2 (*****Legal operators for use in 
> real expressions)* and 11-3 (*****Operators not allowed for real 
> expressions),* which immediately follow it, are redundant and the 
> duplication invites inconsistency.
> 
> Any objections to deleting those two tables, with a sentence referring 
> back to Table 11-1?
> 
> Thanks,
> Shalom
>

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Aug 28 05:08:42 2007

This archive was generated by hypermail 2.1.8 : Tue Aug 28 2007 - 05:09:08 PDT