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 />

* (multiplication)<br />

Index3 idx_mult_idx = idx_1 * idx_2;<br />

// Value for idx_mult_idx is (27, 65, 119) from 3*9, 5*13, 7*17<br />

Index3 idx_mult_int = idx_1 * 5;<br />

// Value for idx_mult_int is (15, 25, 35) from 3*5, 5*5, 7*5<br />

/ (division)<br />

Index3 int_mult_idx = 5 * idx_1;<br />

// Value for int_mult_idx is (15, 25, 35) from 5*3, 5*5, 5*7<br />

Index3 idx_div_idx = idx_1 / idx_2;<br />

// Value for idx_div_idx is (0, 0, 0) from 3/9, 5/13, 7/17<br />

Index3 idx_div_int = idx_1 / 5;<br />

// Value for idx_div_int is (0, 1, 1) from 3/5, 5/5, 7/5<br />

Index3 int_div_idx = 5 / idx_1;<br />

// Value for int_div_idx is (1, 1, 0) from 5/3, 5/5, 5/7<br />

!= (not equal to)<br />

if (idx_1 != idx_2)<br />

// test is true<br />

== (equal to)<br />

if (idx_1 == idx_2)<br />

// test is false<br />

Cast other Index types to this type.<br />

Index2 idx2 = new Index2(5, 7);<br />

Index3 idx3_from_idx2 = (Index3)idx2;<br />

// idx3_from_idx2 value is (5, 7, 0);<br />

Index4 idx4 = new Index4(3, 5, 7, 9)<br />

Index3 idx3_from_idx4 = (Index3)idx4;<br />

// idx3_from_idx4 value is (3, 5, 7);<br />

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

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

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

Saved successfully!

Ooh no, something went wrong!