summaryrefslogtreecommitdiff
path: root/mathunit.pas
blob: 3d5e111d6436531b6f87a630ee34d5061aa03a9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
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.