Difference between revisions of "symmetric difference"
From Free Pascal wiki
Jump to navigationJump to search (Created page with "<div style="float:left; margin: 0 20px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;"><nowiki> >< </nowiki>...") |
(typeset mathematical formula in LaTeX, mention conformity to Extended Pascal, remove manual listing of Category: Symbols already done via transcluded {{Symbols}}) |
||
(3 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | <div style="float: | + | <div style="float:right; margin: 0 10px 10px 0; padding:40px; font-size:500%; font-family: Georgia; background-color: #f9f9f9; border: 2px solid #777777;"><nowiki>><</nowiki></div> |
− | The symmetric difference operator is applicable to set variables. By | + | The symmetric difference operator is applicable to [[Set|<syntaxhighlight lang="pascal" inline>set</syntaxhighlight>]] variables. |
+ | By mathematical definition, <syntaxhighlight lang="pascal" inline style="whitespace: nowrap;">A >< B</syntaxhighlight> is <math>\left( A \setminus B \right) \cup \left( B \setminus A \right)</math>. | ||
− | <syntaxhighlight lang="pascal" highlight=" | + | <syntaxhighlight lang="pascal" highlight="7"> |
− | |||
− | |||
procedure test_differ; | procedure test_differ; | ||
var | var | ||
− | a: set of char = ['a', 'b', 'c | + | a: set of char = ['a', 'b', 'c']; |
b: set of char = ['b', 'c', 'x', 'y']; | b: set of char = ['b', 'c', 'x', 'y']; | ||
c: set of char; | c: set of char; | ||
begin | begin | ||
− | c:= a >< b; // c becomes ['a | + | c:= a >< b; // c becomes ['a', 'x', 'y'] |
end; | end; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | The symmetric difference operator is defined by [[Extended Pascal|Extended Pascal]], ISO standard 10206. | ||
+ | In the [[FPC]] it is available in ''any'' mode, not just [[Mode extendedpascal|<syntaxhighlight lang="delphi" inline style="whitespace: nowrap;">{$mode extendedPascal}</syntaxhighlight>]]. | ||
{{Symbols}} | {{Symbols}} | ||
− |
Latest revision as of 17:03, 27 January 2022
><
The symmetric difference operator is applicable to set
variables.
By mathematical definition, A >< B
is [math]\displaystyle{ \left( A \setminus B \right) \cup \left( B \setminus A \right) }[/math].
procedure test_differ;
var
a: set of char = ['a', 'b', 'c'];
b: set of char = ['b', 'c', 'x', 'y'];
c: set of char;
begin
c:= a >< b; // c becomes ['a', 'x', 'y']
end;
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}
.
single characters |
|
character pairs |
|