# Exemples / DO-DON'T — Chapitre 20 — Opérateurs > Document compagnon non normatif tant qu'une règle n'est pas explicitement référencée comme normative par le chapitre. ## Exemples actuellement présents dans le chapitre ### Exemple 1 ```text OpPositive OpNegate OpAdd OpSubtract OpMultiply OpDivide OpRemainder ``` ### Exemple 2 ```text Vector3 * float64 -> Vector3 Matrix * Vector3 -> Vector3 Timestamp + Duration -> Timestamp Timestamp - Timestamp -> Duration ``` ### Exemple 3 ```text OpBitNot OpBitAnd OpBitOr OpBitXor OpShiftLeft OpShiftRight ``` ### Exemple 4 ```text statique -> erreur compilation dynamique -> faute runtime ``` ### Exemple 5 ```text unsigned -> logical zero-fill signed -> arithmetic sign extension ``` ### Exemple 6 ```text !a a && b a || b ``` ### Exemple 7 ```text a & b a | b a ^ b ``` ### Exemple 8 ```text OpPartialEqual OpEqual ``` ### Exemple 9 ```text OpPartialEqual ``` ### Exemple 10 ```text réflexive symétrique transitive ``` ### Exemple 11 ```text public enum Ordering { Less, Equal, Greater, Unordered } ``` ### Exemple 12 ```text OpPartialCompare OpCompare ``` ### Exemple 13 ```text OpIndex OpIndexMut ``` ### Exemple 14 ```text container[index] container[index] = value ``` ### Exemple 15 ```text Map OpIndex> OpIndexMut ``` ### Exemple 16 ```text if (a = b) { ... } x = (a = b); a = b = c; ``` ### Exemple 17 ```text += -= *= /= %= &= |= ^= <<= >>= ``` ### Exemple 18 ```text lecture + opérateur fondamental surchargeable + réaffectation ``` ### Exemple 19 ```text value is Type ``` ### Exemple 20 ```text value is Animal // true value is Dog // true value is Labrador // true ``` ### Exemple 21 ```text !(value is Type) ``` ### Exemple 22 ```text value instanceof ConcreteClass ``` ### Exemple 23 ```text value instanceof Animal // false value instanceof Dog // false value instanceof Labrador // true ``` ### Exemple 24 ```text !(value instanceof ConcreteClass) ``` ### Exemple 25 ```text bitcast(value) ``` ### Exemple 26 ```text 1. qualification / membre . :: 2. appel / indexation () [] 3. préfixes +x -x !x ~x 4. multiplicatifs * / % 5. additifs + - 6. shifts << >> 7. relation / type < <= > >= is instanceof 8. égalité == != 9. bitwise AND & 10. bitwise XOR ^ 11. bitwise OR | 12. logique short-circuit AND && 13. logique short-circuit OR || ``` ### Exemple 27 ```text a < b < c -> interdit a == b == c -> interdit ``` ### Exemple 28 ```text a < b && b < c ``` ## DO / DON'T / WHY / compiler error / edge cases La couverture structurée de cette section sera enrichie au fur et à mesure de la fermeture des règles du chapitre. La migration `0.2.12` conserve volontairement les exemples historiques dans le chapitre afin de ne perdre aucun contexte normatif.