diff options
author | Erich Eckner <git@eckner.net> | 2016-02-04 16:30:02 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2016-02-04 16:30:02 +0100 |
commit | f805884d7f17658fec112f94a8723efce9a6c8f1 (patch) | |
tree | f8c3fd5086058b6da7e71e5380685f97eb85197f /lowlevelunit.pas | |
parent | 1dd3e8b3c60999f58e6a3051ec45c137953c2174 (diff) | |
download | units-f805884d7f17658fec112f94a8723efce9a6c8f1.tar.xz |
neue überladene Operatoren in lowlevelunit.pas
Diffstat (limited to 'lowlevelunit.pas')
-rw-r--r-- | lowlevelunit.pas | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/lowlevelunit.pas b/lowlevelunit.pas index 7ff4268..e7be518 100644 --- a/lowlevelunit.pas +++ b/lowlevelunit.pas @@ -36,6 +36,10 @@ type tWarnstufe = (wsStreng,wsLasch); tGenauigkeit = (gSingle,gDouble,gExtended); +operator = (x1,x2: t2x2Extended): boolean; +operator = (x1,x2: tIntPoint): boolean; +operator = (x1,x2: tExtPoint): boolean; + function signSqr(x: extended): extended; inline; function mpfToStr(f: mpf_t): string; function myTimeToStr(t: extended): string; @@ -104,6 +108,36 @@ implementation uses matheunit, systemunit; +// überladene operatoren ******************************************************* + +operator = (x1,x2: t2x2Extended): boolean; +var + c,d: char; +begin + result:=true; + for c:='x' to 'y' do + for d:='x' to 'y' do + result:=result and (x1[c,d]=x2[c,d]); +end; + +operator = (x1,x2: tIntPoint): boolean; +var + c: char; +begin + result:=true; + for c:='x' to 'y' do + result:=result and (x1[c]=x2[c]); +end; + +operator = (x1,x2: tExtPoint): boolean; +var + c: char; +begin + result:=true; + for c:='x' to 'y' do + result:=result and (x1[c]=x2[c]); +end; + // allgemeine Funktionen ******************************************************* function signSqr(x: extended): extended; |