symmetric difference

From Free Pascal wiki
Revision as of 12:30, 11 November 2018 by Alextp (talk | contribs) (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>...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
><

The symmetric difference operator is applicable to set variables. By math definition, A >< B is (A-B) joined with (B-A).

// make operator overloading available
{$mode objfpc}
procedure test_differ;
var
  a: set of char = ['a', 'b', 'c', 's'];
  b: set of char = ['b', 'c', 'x', 'y'];
  c: set of char;
begin
  c:= a >< b; // c becomes ['a', 's', 'x', 'y']
end;



navigation bar: topic: Pascal symbols
single characters

+ (plus)  •  - (minus)  •  * (asterisk)  •  / (slash)
= (equal)  •  > (greater than)  •  < (less than)
. (period)  •  : (colon)  •  ; (semi colon)
^ (hat)  •  @ (at)
$ (dollar sign)  •  & (ampersand)  •  # (hash)
' (single quote)

character pairs

<> (not equal)  •  <= (less than or equal)  •  := (becomes)  •  >= (greater than or equal)

 •  >< (symmetric difference)  •  // (double slash)