diff options
author | Erich Eckner <git@eckner.net> | 2021-02-01 11:56:21 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2021-02-01 11:56:21 +0100 |
commit | da7fb46d70ead949fa805ca72419c0b2abce546e (patch) | |
tree | 884475a4cf216422111baeaeab8caa696913dce8 /matheunit.pas | |
parent | ef7ca3b4a7ccdaa96b0e5628897916eca2d67302 (diff) | |
download | units-da7fb46d70ead949fa805ca72419c0b2abce546e.tar.xz |
matheunit.pas: intRoot neu
Diffstat (limited to 'matheunit.pas')
-rw-r--r-- | matheunit.pas | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/matheunit.pas b/matheunit.pas index dd3517c..a5163c8 100644 --- a/matheunit.pas +++ b/matheunit.pas @@ -64,6 +64,7 @@ function formelnAuswerten(s: string; kvs: tKnownValues; cbgv: tCallBackGetValue) function knownValue(nam: string; val: extended): tKnownValue; function berechneEinheitsZelle(invarianz,modulus: tInt64Point): tInt64Point; function ggT(a,b: int64): int64; +function intRoot(n: int64): int64; function ermittleAnstieg(dat: string; xSpalte,ySpalte: longestOrdinal): extended; function ermittleMittelwert(dat: string; werteSpalte,gewichteSpalte: longestOrdinal): extended; procedure sortiereNachWert(var maxima: tLongintArray; werte: tExtendedArray; logarithmischesPivot: boolean); @@ -998,6 +999,17 @@ begin // a <= b result:=b; end; +function intRoot(n: int64): int64; +begin + if n<=0 then begin + result:=0; + exit; + end; + result:=floor(sqrt(n)); + while n mod result > 0 do + dec(result); +end; + function ermittleAnstieg(dat: string; xSpalte,ySpalte: longestOrdinal): extended; var f: textFile; |