02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Basics<br />

returned value is less than zero, 'x' is less than the interval [low, high]. If the returned<br />

value is zero, 'x' is inside the interval [low, high]. If the returned value is greater than zero,<br />

'x' is greater than the interval [low, high]. Also available as SignInterval(T x,<br />

Range1 range).<br />

Algorithm.SignInterval(3, 4, 6)<br />

// result is -1<br />

Algorithm.SignInterval(5, 4, 6)<br />

// result is 0<br />

Algorithm.SignInterval(7, 4, 6)<br />

// result is 1<br />

Swap(T a, T b) – This method takes two arguments, a and b, and interchanges<br />

the values of elements a and b.<br />

int a = 3;<br />

int b = 5;<br />

Algorithm.Swap(ref a,ref b);<br />

// result a=5,b=3;<br />

<strong>Schlumberger</strong> Private<br />

<strong>Ocean</strong> Services 4-131

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

Saved successfully!

Ooh no, something went wrong!