$Log2 or $Log 2: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision: from DME w/ love)
mNo edit summary
Line 1: Line 1:
<span class="pageSubtitle">Log base 2 function</span>
<span class="pageSubtitle">Log base 2 function</span>
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented
<p class="warning">Most Sirius $functions have been deprecated in favor of Object Oriented
Line 10: Line 9:
</p>
</p>


The <var>$Log2</var> function returns the base-2 logarithm
The <var>$Log2</var> function (or its alias, <var>$Log_2</var>) returns the base-2 logarithm
of the number ''x''.
of the number ''x''.


==Syntax==
==Syntax==
<p class="syntax"><span class="term">%num</span><span class="literal"> = $Log2(</span><span class="term">x</span><span class="literal">)</span>  </p>
<p class="syntax"><span class="term">%num</span><span class="literal"> = $Log2(</span><span class="term">x</span><span class="literal">)</span>  </p>
<p class="syntax"><span class="term">%num</span><span class="literal"> = $Log_2(</span><span class="term">x</span><span class="literal">)</span>  </p>


If ''x'' is not greater than 0,
If ''x'' is not greater than 0,

Revision as of 20:11, 10 January 2012

Log base 2 function

Most Sirius $functions have been deprecated in favor of Object Oriented methods. The OO equivalent for the $Log2 function is the Log2 function.

The $Log2 function (or its alias, $Log_2) returns the base-2 logarithm of the number x.

Syntax

%num = $Log2(x)

%num = $Log_2(x)

If x is not greater than 0, an error message is printed and a 0 is returned.

See the SIRFUNC EXEC parameter for an explanation of when this high-performance, high-precision version of the IBM mathematical function from the Sirius Mods is used, as opposed to the version of the $function in the Model 204 FUND or FUNDLE CSECT.