13.07.2015 Views

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

C# Language Specification - Willy .Net

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>C#</strong> LANGUAGE SPECIFICATION}public static explicit operator bool(DBBool x) {if (x.value == 0) throw new InvalidOperationException();return x.value > 0;}// Equality operator. Returns Null if either operand is Null,// otherwise returns True or False.public static DBBool operator ==(DBBool x, DBBool y) {if (x.value == 0 || y.value == 0) return Null;return x.value == y.value? True: False;}// Inequality operator. Returns Null if either operand is Null,// otherwise returns True or False.public static DBBool operator !=(DBBool x, DBBool y) {if (x.value == 0 || y.value == 0) return Null;return x.value != y.value? True: False;}// Logical negation operator. Returns True if the operand is False,// Null if the operand is Null, or False if the operand is True.public static DBBool operator !(DBBool x) {return new DBBool(-x.value);}// Logical AND operator. Returns False if either operand is False,// otherwise Null if either operand is Null, otherwise True.public static DBBool operator &(DBBool x, DBBool y) {return new DBBool(x.value < y.value? x.value: y.value);}// Logical OR operator. Returns True if either operand is True,// otherwise Null if either operand is Null, otherwise False.public static DBBool operator |(DBBool x, DBBool y) {return new DBBool(x.value > y.value? x.value: y.value);}// Definitely true operator. Returns true if the operand is True,// false otherwise.public static bool operator true(DBBool x) {return x.value > 0;}// Definitely false operator. Returns true if the operand is False,// false otherwise.public static bool operator false(DBBool x) {return x.value < 0;}End of informative text.274

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!