ToIntegerPower and ToPower (Float functions): Difference between revisions

From m204wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 11: Line 11:
Available as of version 7.3 of the [[Sirius Mods]], the ToIntegerPower and ToPower functions are
Available as of version 7.3 of the [[Sirius Mods]], the ToIntegerPower and ToPower functions are
object-oriented versions of the $RXPI function.
object-oriented versions of the $RXPI function.
===ToPower syntax===
==Syntax==
{{Template:Float:ToIntegerPower syntax}}
{{Template:Float:ToIntegerPower syntax}}
{{Template:Float:ToPower syntax}}
{{Template:Float:ToPower syntax}}
====Syntax terms====
===Syntax terms===
<dl>
<dl>
<dt>%value
<dt>%value
Line 23: Line 23:
<dd>A Float value, which is rounded to the nearest integer.
<dd>A Float value, which is rounded to the nearest integer.
</dl>
</dl>
===Usage Notes===
==Usage Notes==
*If ''number'' is 0 and ''exponent'' is less than or equal to 0, the request is cancelled.
*If ''number'' is 0 and ''exponent'' is less than or equal to 0, the request is cancelled.
===Examples===
===Examples===
Line 33: Line 33:
     printText {~} is {2:toIntegerPower(-2.2)}
     printText {~} is {2:toIntegerPower(-2.2)}


===See also===
==See also==
[[List of intrinsic Float methods]]
[[List of intrinsic Float methods]]
[[Category: Intrinsic Float methods|ToIntegerPower and ToPower function]]  
[[Category: Intrinsic Float methods|ToIntegerPower and ToPower function]]  

Revision as of 13:57, 19 January 2011

Template:Float:ToIntegerPower subtitle

Template:Float:ToPower subtitle

These intrinsic functions return a number that is the method object value raised to the power specified by the method argument. The argument value is initially rounded to the nearest integral value.

ToPower is a synonym for ToIntegerPower.

Available as of version 7.3 of the Sirius Mods, the ToIntegerPower and ToPower functions are object-oriented versions of the $RXPI function.

Syntax

%number = float:ToIntegerPower( exponent)

%number = float:ToPower( exponent)

Syntax terms

%value
A numeric variable to contain the method result.
number
A Float value.
exponent
A Float value, which is rounded to the nearest integer.

Usage Notes

  • If number is 0 and exponent is less than or equal to 0, the request is cancelled.

Examples

The following statement returns “3:toPower(5) = 243”.

   printText {~} = {3:toPower(5)}

The following statement returns “-.1:toPower(2.8) is -0.001”.

   printText {~} is {-.1:toPower(2.8)}

The following statement returns “2:toIntegerPower(-2.2) is 0.25”.

   printText {~} is {2:toIntegerPower(-2.2)}

See also

List of intrinsic Float methods