X hits on this document

789 views

0 shares

162 / 396

Chapter ‎18   Unsafe code

x < y

true if x is less than y, false otherwise

x > y

true if x is greater than y, false otherwise

x <= y

true if x is less than or equal to y, false otherwise

x >= y

true if x is greater than or equal to y, false otherwise

### 7.9.1 Integer comparison operators

The predefined integer comparison operators are:

bool operator ==(int x, int y); bool operator ==(uint x, uint y); bool operator ==(long x, long y); bool operator ==(ulong x, ulong y);

bool operator !=(int x, int y); bool operator !=(uint x, uint y); bool operator !=(long x, long y); bool operator !=(ulong x, ulong y);

bool operator <(int x, int y); bool operator <(uint x, uint y); bool operator <(long x, long y); bool operator <(ulong x, ulong y);

bool operator >(int x, int y); bool operator >(uint x, uint y); bool operator >(long x, long y); bool operator >(ulong x, ulong y);

bool operator <=(int x, int y); bool operator <=(uint x, uint y); bool operator <=(long x, long y); bool operator <=(ulong x, ulong y);

bool operator >=(int x, int y); bool operator >=(uint x, uint y); bool operator >=(long x, long y); bool operator >=(ulong x, ulong y);

Each of these operators compares the numeric values of the two integer operands and returns a bool value that indicates whether the particular relation is true or false.

### 7.9.2 Floating-point comparison operators

The predefined floating-point comparison operators are:

bool operator ==(float x, float y); bool operator ==(double x, double y);

bool operator !=(float x, float y); bool operator !=(double x, double y);

bool operator <(float x, float y); bool operator <(double x, double y);

bool operator >(float x, float y); bool operator >(double x, double y);