IsPrime (Float function): Difference between revisions
Jump to navigation
Jump to search
m (printtext) |
m (printtext) |
||
Line 15: | Line 15: | ||
==Usage notes== | ==Usage notes== | ||
<ul><li>If <var class="term">float</var> is a negative value or is greater than 2<sup>31</sup>-1, the request is canceled. | <ul><li>If <var class="term">float</var> is a negative value or is greater than 2<sup>31</sup>-1, the request is canceled. | ||
<li><var>IsPrime</var> is available as of <var class="product">[[Sirius Mods| | <li><var>IsPrime</var> is available as of <var class="product">[[Sirius Mods|Sirius Mods]]</var> Version 7.3.</ul> | ||
==Examples== | ==Examples== |
Revision as of 17:46, 4 May 2011
Is this number prime? (Float class)
The IsPrime intrinsic function returns a boolean value that indicates whether the method object value, rounded to an integer, is prime. The method returns 'True
' if float is prime, and it returns 'False
' if it is not prime.
Syntax
%boolean = float:IsPrime
Syntax terms
%boolean | An enumeration object of type Boolean to contain the returned value of IsPrime. |
---|---|
float | A Float value. |
Usage notes
- If float is a negative value or is greater than 231-1, the request is canceled.
- IsPrime is available as of Sirius Mods Version 7.3.
Examples
- The following statement returns '
113:isprime = True
'.printText {~} = {113:isprime}
The enumeration value is printed, above, as the result of an implicit ToString property call.