From Clomosy Docs
(Created page with " function Ln(Number Extended):Extended; The Ln function takes an integer or floating point Number and gives the natural logarithm of that number. This is only used for mathematical processing.<br> Ln has the opposite effect to Exp - the exponent of a number.<br> '''Example:'''<br> '''var''' float,number : float;<br> '''begin'''<br> number := 2.14; float := Ln(number); ShowMessage('Ln('+FloatToStr(number)+') = '+FloatToStr(float));<br> float := Exp(f...") |
No edit summary |
||
| Line 6: | Line 6: | ||
'''Example:'''<br> | '''Example:'''<br> | ||
:'''Base Syntax''' | |||
var | |||
float,number : float; | |||
begin | |||
number := 2.14; | |||
float := '''Ln'''(number); | |||
ShowMessage('Ln('+FloatToStr(number)+') = '+FloatToStr(float)); | |||
float := Exp(float); | |||
ShowMessage('Exp(Ln('+FloatToStr(float)+')) = '+FloatToStr(float)); | |||
end; | |||
:'''TRObject Syntax''' | |||
var | |||
float,number : float; | |||
{ | |||
number = 2.14; | |||
float = '''Ln'''(number); | |||
ShowMessage('Ln('+FloatToStr(number)+') = '+FloatToStr(float)); | |||
float = Exp(float); | |||
ShowMessage('Exp(Ln('+FloatToStr(float)+')) = '+FloatToStr(float)); | |||
} | |||
'''Output:'''<br> | '''Output:'''<br> | ||
Ln(2,14) = 0,76080582903376 | Ln(2,14) = 0,76080582903376 | ||
Exp(Ln(2,14)) = 2,14 | Exp(Ln(2,14)) = 2,14 | ||
Revision as of 12:57, 13 February 2024
function Ln(Number Extended):Extended;
The Ln function takes an integer or floating point Number and gives the natural logarithm of that number. This is only used for mathematical processing.
Ln has the opposite effect to Exp - the exponent of a number.
Example:
- Base Syntax
var
float,number : float;
begin
number := 2.14;
float := Ln(number);
ShowMessage('Ln('+FloatToStr(number)+') = '+FloatToStr(float));
float := Exp(float);
ShowMessage('Exp(Ln('+FloatToStr(float)+')) = '+FloatToStr(float));
end;
- TRObject Syntax
var
float,number : float;
{
number = 2.14;
float = Ln(number);
ShowMessage('Ln('+FloatToStr(number)+') = '+FloatToStr(float));
float = Exp(float);
ShowMessage('Exp(Ln('+FloatToStr(float)+')) = '+FloatToStr(float));
}
Output:
Ln(2,14) = 0,76080582903376 Exp(Ln(2,14)) = 2,14