mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-05 11:38:29 +02:00
* log2() and log10(): replaced division by ln(base) with multiplication by reciprocal constant, this executes faster and somehow provides slightly better accuracy.
git-svn-id: trunk@26086 -
This commit is contained in:
parent
c7213b7ff1
commit
636736dda6
@ -854,12 +854,12 @@ function hypot(x,y : float) : float;
|
||||
|
||||
function log10(x : float) : float;
|
||||
begin
|
||||
log10:=ln(x)/ln(10);
|
||||
log10:=ln(x)*0.43429448190325182765; { 1/ln(10) }
|
||||
end;
|
||||
|
||||
function log2(x : float) : float;
|
||||
begin
|
||||
log2:=ln(x)/ln(2)
|
||||
log2:=ln(x)*1.4426950408889634079; { 1/ln(2) }
|
||||
end;
|
||||
|
||||
function logn(n,x : float) : float;
|
||||
|
Loading…
Reference in New Issue
Block a user