summaryrefslogtreecommitdiff
path: root/matheunit.pas
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2016-03-10 09:54:25 +0100
committerErich Eckner <git@eckner.net>2016-03-15 13:01:16 +0100
commit7f75a6ee2c2aab633a76bdb1e3183eaa80c3c48b (patch)
treec5bbbb0a2ad4d53164c9c22268ab39ebd1d88dbb /matheunit.pas
parent2620b2d1dbc4c5965101d894a784ebd2b1676940 (diff)
downloadunits-7f75a6ee2c2aab633a76bdb1e3183eaa80c3c48b.tar.xz
round,floor,ceil neu in exprToFloat ind matheunit.pas
Diffstat (limited to 'matheunit.pas')
-rw-r--r--matheunit.pas5
1 files changed, 4 insertions, 1 deletions
diff --git a/matheunit.pas b/matheunit.pas
index 7b00e52..c913ae5 100644
--- a/matheunit.pas
+++ b/matheunit.pas
@@ -394,7 +394,7 @@ var i,j,k,l,m: longint;
inv,neg,cbv: boolean;
val1,val2: extended;
const
- fkt1: array[0..6] of string = ('exp','sin','cos','tan','sqr','sqrt','ln');
+ fkt1: array[0..9] of string = ('exp','sin','cos','tan','sqr','sqrt','ln','round','floor','ceil');
fkt2: array[0..1] of string = ('min','max');
begin
s:=trimAll(s);
@@ -423,6 +423,9 @@ begin
4: val1:=sqr(val1);
5: val1:=sqrt(val1);
6: val1:=ln(val1);
+ 7: val1:=round(val1);
+ 8: val1:=floor(val1);
+ 9: val1:=ceil(val1);
end{of case};
s:=copy(s,1,k-1) + floattostr(val1) + copy(s,j+1,length(s));
end;