Home > Back-end >  What with logarithmic computing function, such as: log0.21, log8 etc.
What with logarithmic computing function, such as: log0.21, log8 etc.

Time:09-25

What with logarithmic computing function, such as: log0.21, log8 etc., with what function result is right?

CodePudding user response:

I don't use DELPHI function for, calculator to calculate the result is as follows:
Log0.21=0.67778070526608073199275583815225
Log8=0.90308998699194358564121668417348

CodePudding user response:

Delpi logarithmic function

A logarithmic function commonly used,
1, Ln ()//natural logarithm
2, for the sake of convenience, the use of logarithmic formula: in bottom Logb N=Loga N/Loga b, define a Log function (10 at the bottom)
The function log (n: Real) : Real;
The begin
Result:=Ln (n)/Ln (10.0);
end;

Second, special logarithmic function, use math unit
1, function LnXP1 (const X: Extended) : Extended;//Ln (X + 1), accurate for X near zero
2, Log10 () function (const X: Extended) : Extended;//base for 10 X logarithm
3, the function of Log2 (const X: Extended) : Extended;//base for 2 X logarithm
4, function LogN (const Base, X: Extended) : Extended;//base for N X logarithmic

CodePudding user response:

Mathematics is: ln x=loge x
Should use ln0.21 log8 is ok, but the results with MS calculator to calculate the result is different,

CodePudding user response:

DELPHI logarithmic not 10 at the bottom, so I need one more step:
The log (8)=ln (8.0)/ln (10.0);
=0.903089986991944

CodePudding user response:

=0.9030899869919435856412166841734790803045696443863256239312823833813245678232735284607817563545585161 Log10 (8)
The Log (0.21)=0.6777807052660807319927558381522484973162987394853387286664994059765174073142597108909201165048951251
  • Related