Java High puzzles 87: tense relations
In math, equal (=) definition of a true relationship between the equivalence between the number of (equivalence relation). This equivalence relations will be divided into a set number of equivalence classes (equivalence class), each by the equivalent of the value of all the same composition of each other. Other equivalence relations, including all triangles on the set of "equivalence" between the set and all of the "same page" of relations. In fact, the relationship is a kind of equivalent to, if and only if it is reflexive, transmission and symmetrical. These properties are defined as follows:- Reflexivity: for all x, x ~ x. In other words, the value of each relationship to its own existence.
- Transitivity: if x and y ~ y ~ z, x-z. In other words, if the first value and the existence value of the second ~ relations, and the second and third values of relationship to exist, then the third with a value of ~ relations also exist.
- Symmetry: If x ~ y, y ~ x. In other words, if the first value and the second value relationship to exist, then the second value and the first value relationship to exist.
Implementation of the transfer of such tips is to use the three numerical comparison to the loss of two precision, and then with the facts can be the opposite result. It can be constructed examples: Select two of the larger but not the same long-assign numerical x and z, and the first two will be a long numerical similar assign numerical double-y. The following procedure is its code, it is the result of printing true true false, and this was clear proof of the operator == role in the original type of transmission is not.
Recommend Articles
February 12, 2006 | Filed Under Core Java |






