symmetric difference: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: symmetric difference
| Old | New | Line | |
|---|---|---|---|
| 1 | + | \>\< | |
| 2 | + | ||
| 3 | + | The symmetric difference operator is applicable to [[Set|set]] variables. By mathematical definition, `A >< B` is $`\left( A \setminus B \right) \cup \left( B \setminus A \right)`$. | |
| 4 | + | ||
| 5 | + | ``` pascal | |
| 6 | + | procedure test_differ; | |
| 7 | + | var | |
| 8 | + | a: set of char = ['a', 'b', 'c']; | |
| 9 | + | b: set of char = ['b', 'c', 'x', 'y']; | |
| 10 | + | c: set of char; | |
| 11 | + | begin | |
| 12 | + | c:= a >< b; // c becomes ['a', 'x', 'y'] | |
| 13 | + | end; | |
| 14 | + | ``` | |
| 15 | + | ||
| 16 | + | The symmetric difference operator is defined by [[Extended Pascal]], ISO standard 10206. In the [[FPC]] it is available in *any* mode, not just [[Mode extendedpascal|{$mode extendedPascal}]]. | |
| 17 | + | ||
| 18 | + | --- | |
| 19 | + | *From the Free Pascal wiki, page "symmetric difference", as it stood on 2022-01-27 after a change by Kai Burghardt, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
