diff options
author | Erich Eckner <git@eckner.net> | 2018-10-02 06:14:03 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-10-02 06:14:12 +0200 |
commit | 16c991a95cc7855ebf9ad2d3936e81a889dc8ef5 (patch) | |
tree | 8c8a01f329fcfebe5529f8c7599049cbd4c49105 | |
parent | 91332c5ee67aa243084d786e5298e08ec3adf22c (diff) | |
download | units-16c991a95cc7855ebf9ad2d3936e81a889dc8ef5.tar.xz |
conditional uses for win64
-rw-r--r-- | matheunit.pas | 34 | ||||
-rw-r--r-- | mystringlistunit.pas | 2 |
2 files changed, 20 insertions, 16 deletions
diff --git a/matheunit.pas b/matheunit.pas index 30fa966..9b88009 100644 --- a/matheunit.pas +++ b/matheunit.pas @@ -5,7 +5,7 @@ unit matheunit; interface uses - Classes, SysUtils, Gmp, Math, lowlevelunit, protokollunit; + Classes, SysUtils{$IFNDEF win64}, gmp{$ENDIF}, Math, lowlevelunit, protokollunit; type tCallBackGetValue = function(name: string): extended of object; @@ -39,9 +39,11 @@ type function plus(a,b: tExtPoint): tExtPoint; function durch(a: tExtPoint; b: extended): tExtPoint; function myFrac(x: extended): extended; +{$IFNDEF win64} function mpfToStr(f: mpf_t): string; -function signSqr(x: extended): extended; inline; function mpfMyRoot(rad: mpf_t; wzlExp: int64): extended; +{$ENDIF} +function signSqr(x: extended): extended; inline; function myTimeToStr(t: extended): string; function cmpStr(s1,s2: string): longint; function mitte(s1,s2: string): string; @@ -295,24 +297,20 @@ begin result:=result+1; end; +{$IFNDEF win64} function mpfToStr(f: mpf_t): string; var ex: mp_exp_t; off: byte; begin - result:=mpf_get_str(nil,ex,10,0,f); - off:=1+byte(pos('-',result)=1); - if result='' then - result:='0' - else if ex=1 then - result:=copy(result,1,off)+','+copy(result,off+1,length(result)-off) - else - result:=copy(result,1,off)+','+copy(result,off+1,length(result)-off)+' * 10^'+intToStr(ex-1); -end; - -function signSqr(x: extended): extended; -begin - result:=sign(x)*sqr(x); + result:=mpf_get_str(nil,ex,10,0,f); + off:=1+byte(pos('-',result)=1); + if result='' then + result:='0' + else if ex=1 then + result:=copy(result,1,off)+','+copy(result,off+1,length(result)-off) + else + result:=copy(result,1,off)+','+copy(result,off+1,length(result)-off)+' * 10^'+intToStr(ex-1); end; function mpfMyRoot(rad: mpf_t; wzlExp: int64): extended; @@ -322,6 +320,12 @@ begin result:=power(mpf_get_d_2exp(ex,rad),1/wzlExp); result:=result*power(2,ex/wzlExp); end; +{$ENDIF} + +function signSqr(x: extended): extended; +begin + result:=sign(x)*sqr(x); +end; function myTimeToStr(t: extended): string; var diff --git a/mystringlistunit.pas b/mystringlistunit.pas index 46862aa..8c152e6 100644 --- a/mystringlistunit.pas +++ b/mystringlistunit.pas @@ -55,7 +55,7 @@ function istDasBefehl(befehl: string; var s: string; var bekannteBefehle: tMyStr implementation -uses Math, lowlevelunit, systemunit, fileUnit; +uses Math, lowlevelunit, systemunit, fileUnit{$IFDEF win64}, windows{$ENDIF}; // tMyStringList *************************************************************** |