diff options
author | Erich Eckner <git@eckner.net> | 2014-09-23 16:12:24 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2014-09-23 16:12:24 +0200 |
commit | 17ec74a07cacd08b0904b29a390d3b7f26ba7b1b (patch) | |
tree | aeea32b00bf5d45b554e62c75cb59881b2594915 /mathunit.pas | |
download | ROM-17ec74a07cacd08b0904b29a390d3b7f26ba7b1b.tar.xz |
Initialer Commit
Diffstat (limited to 'mathunit.pas')
-rw-r--r-- | mathunit.pas | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/mathunit.pas b/mathunit.pas new file mode 100644 index 0000000..3d5e111 --- /dev/null +++ b/mathunit.pas @@ -0,0 +1,46 @@ +unit mathunit; + +{$mode objfpc}{$H+} + +interface + +uses + Classes, SysUtils; + +type + tExtPoint = record + x,y: extended; + end; + tExtPointArray = array of tExtPoint; + pTExtPointArray = ^tExtPointArray; + tLongintArray = array of longint; + pTLongintArray = ^tLongintArray; + tExtendedArray = array of extended; + +function Plus(a,b: tExtPoint): tExtPoint; +function Durch(a: tExtPoint; b: extended): tExtPoint; +function myFrac(x: extended): extended; + +implementation + +function Plus(a,b: tExtPoint): tExtPoint; +begin + result.x:=a.x+b.x; + result.y:=a.y+b.y; +end; + +function Durch(a: tExtPoint; b: extended): tExtPoint; +begin + result.x:=a.x/b; + result.y:=a.y/b; +end; + +function myFrac(x: extended): extended; +begin + result:=frac(x); + while result<0 do + result:=result+1; +end; + +end. + |