log: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(,)
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *A([a-z ])" to "$1 - a$2")
 
(54 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Command|= Comments
{{RV|type=command
____________________________________________________________________________________________


| ofp |= Game name
|game1= ofp
|version1= 1.00


|1.00|= Game version
|game2= ofpe
____________________________________________________________________________________________
|version2= 1.00


| Base-10 logarithm of x. |= Description
|game3= arma1
____________________________________________________________________________________________
|version3= 1.00


| [[Number]] <nowiki>=</nowiki> '''log''' x |= Syntax
|game4= arma2
|version4= 1.00


|p1= x: [[Number]]
|game5= arma2oa
|version5= 1.50


| [[Number]] |= Return value
|game6= tkoh
____________________________________________________________________________________________
|version6= 1.00
 
|x1= <code>_log = [[log]] 10; // 1</code> |= Example 1
____________________________________________________________________________________________


| [[Math Commands]], [http://en.wikipedia.org/wiki/Logarithm Logarithm] |= See also
|game7= arma3
|version7= 0.50


|gr1= Math
|descr= Base-10 logarithm of x. [[File:A3 logx.jpg|thumb|The function of log(x) will never touch the y-axis.]]
|s1= [[log]]  x
|p1= x: [[Number]] - a positive number
|r1= [[Number]]
|x1= <sqf>_log = log 10;</sqf>
|x2= <sqf>_log = log abs -10;</sqf>
|x3= <sqf>finite log -10; // Returns false</sqf>
|seealso= [[Math Commands]] {{Link|https://en.wikipedia.org/wiki/Logarithm|Logarithm}}
}}
}}


<h3 style="display:none">Notes</h3>
<dl class="command_description">
<dl class="command_description">
<!-- Note Section BEGIN -->
 
<dt></dt>
<dd class="notedate">Posted on 23:14, 16 Jun 2014</dd>
<dd class="notedate">Posted on 23:14, 16 Jun 2014</dd>
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt>
<dt class="note">[[User:ffur2007slx2_5|ffur2007slx2_5]]</dt>
<dd class="note">
<dd class="note">
(A3 1.20) To clarify:
To clarify:
<code>y = 10 ^ x // x = [[log]] y</code>
<sqf>y = 10 ^ x // x = log y</sqf>
People use logarithm at the purpose of simplifying multiplication via exponents plus years before.
People use logarithm at the purpose of simplifying multiplication via exponents plus years before.
<code>23456*45634 = 1.07039e+009
<sqf>23456*45634 = 1.07039e9
[[log]] 23456 = 4.37025; [[log]] 45634 = 4.65929; ([[log]] 23456) + ([[log]] 45634) = 9.02954
log 23456 = 4.37025; log 45634 = 4.65929; (log 23456) + (log 45634) = 9.02954
10^(([[log]] 23456) + ([[log]] 45634)) = 10 ^ 9.02954  // same as 23456*45634
10^((log 23456) + (log 45634)) = 10 ^ 9.02954  // same as 23456*45634</sqf>
</code>
As modern usage, for instance, to evaluate another exponent when multiple is known (Which magnitude is 4 times stronger than 8.3 earthquake?):
As modern usage, for instance, to evaluate another exponent when multiple is known (Which magnitude is 4 times stronger than 8.3 earthquake?):
<code>//_Unknown = [[log]] x; 8.3 = [[log]] y
<sqf>//_Unknown = log x; 8.3 = log y
// x = 10 ^_Unknown; y = 10 ^8.3
// x = 10 ^_Unknown; y = 10 ^8.3
//x/y = (10 ^_Unknown)/(10 ^8.3) = [[log]] 4
//x/y = (10 ^_Unknown)/(10 ^8.3) = log 4
// x/y = _Unknown – 8.3 = 0.6
// x/y = _Unknown – 8.3 = 0.6
//_result = 8.9 magnitude
//_result = 8.9 magnitude
_result = ([[log]] 4) + 8.3
_result = (log 4) + 8.3</sqf>
</code>
</dd>
</dd>
<!-- Note Section END -->
 
</dl>
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Scripting Commands|LOG]]
[[Category:Scripting Commands OFP 1.99|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands OFP 1.96|LOG]]
[[Category:Scripting Commands OFP 1.46|LOG]]
[[Category:Scripting Commands ArmA|LOG]]
[[Category:Command_Group:_Math|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands ArmA2|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting Commands Arma 3|{{uc:{{PAGENAME}}}}]]
[[Category:Scripting_Commands_Take_On_Helicopters|{{uc:{{PAGENAME}}}}]]

Latest revision as of 16:20, 8 November 2023

Hover & click on the images for description

Description

Description:
Base-10 logarithm of x.
The function of log(x) will never touch the y-axis.
Groups:
Math

Syntax

Syntax:
log x
Parameters:
x: Number - a positive number
Return Value:
Number

Examples

Example 1:
_log = log 10;
Example 2:
_log = log abs -10;
Example 3:
finite log -10; // Returns false

Additional Information

See also:
Math Commands Logarithm

Notes

Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note
Posted on 23:14, 16 Jun 2014
ffur2007slx2_5
To clarify:
y = 10 ^ x // x = log y
People use logarithm at the purpose of simplifying multiplication via exponents plus years before.
23456*45634 = 1.07039e9 log 23456 = 4.37025; log 45634 = 4.65929; (log 23456) + (log 45634) = 9.02954 10^((log 23456) + (log 45634)) = 10 ^ 9.02954 // same as 23456*45634
As modern usage, for instance, to evaluate another exponent when multiple is known (Which magnitude is 4 times stronger than 8.3 earthquake?):
//_Unknown = log x; 8.3 = log y // x = 10 ^_Unknown; y = 10 ^8.3 //x/y = (10 ^_Unknown)/(10 ^8.3) = log 4 // x/y = _Unknown – 8.3 = 0.6 //_result = 8.9 magnitude _result = (log 4) + 8.3