log: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "<dd class="note">([^}]*)<code>([^<]*)<\/code>" to "<dd class="note">$1<sqf>$2</sqf>")
m (Text replacement - "<sqf>([^↵][^<]*↵[^<]*)<\/sqf>" to "<sqf> $1 </sqf>")
 
(6 intermediate revisions by the same user not shown)
Line 28: Line 28:
|s1= [[log]]  x
|s1= [[log]]  x


|p1= x: [[Number]] - A positive number
|p1= x: [[Number]] - a positive number


|r1= [[Number]]
|r1= [[Number]]
Line 38: Line 38:
|x3= <sqf>finite log -10; // Returns false</sqf>
|x3= <sqf>finite log -10; // Returns false</sqf>


|seealso= [[Math Commands]], {{Wikipedia|Logarithm|Logarithm}}
|seealso= [[Math Commands]] {{Link|https://en.wikipedia.org/wiki/Logarithm|Logarithm}}
}}
}}


Line 50: Line 50:
<sqf>y = 10 ^ x // x = log y</sqf>
<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.
<sqf>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</sqf>
10^((log 23456) + (log 45634)) = 10 ^ 9.02954  // same as 23456*45634
</sqf>
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</code>
_result = (log 4) + 8.3
</sqf>
</dd>
</dd>


</dl>
</dl>

Latest revision as of 19:43, 3 September 2024

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