RE: [sv-bc] enumerated variable used with an equality operator

From: Bresticker, Shalom <shalom.bresticker@intel.com>
Date: Tue Mar 25 2014 - 23:39:49 PDT
That is not a question.

There is no end of different coding styles that are equivalent in some ways, but different in others.

For example, one could ask about the differences between if-else and ?:, or between continuous assignments and always_comb, or between a & b and a&& b.

One difference between equality and relational operators is that equality operations are defined even in cases where relational operations are not.

Shalom


> -----Original Message-----
> From: owner-sv-bc@eda.org [mailto:owner-sv-bc@eda.org] On Behalf Of
> Arturo Salz
> Sent: Tuesday, March 25, 2014 22:58
> To: Steven Sharp; Rich, Dave; Neil Korpusik; sv-bc@eda.org
> Subject: RE: [sv-bc] enumerated variable used with an equality operator
> 
> The distinction you make between relational and identity operators is a
> sensible one, but what's the difference between
>   enum_var == number
> And
>   enum_var >= number && ! (enum_var > number)
> 
> It might seem weird to apply tighter type checking to one and not the
> other, right?
> 
> 	Arturo

---------------------------------------------------------------------
Intel Israel (74) Limited

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Mar 25 23:41:07 2014

This archive was generated by hypermail 2.1.8 : Tue Mar 25 2014 - 23:41:14 PDT