IsPrime (Float function): Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
m (1 revision) |
||
Line 12: | Line 12: | ||
<td>An enumeration object of type Boolean to contain the returned value of <var>IsPrime</var>. </td></tr> | <td>An enumeration object of type Boolean to contain the returned value of <var>IsPrime</var>. </td></tr> | ||
<tr><th>number</th> | <tr><th>number</th> | ||
<td>A Float value.</td></tr> | <td>A <var>Float</var> value.</td></tr> | ||
</table> | </table> | ||
==Usage notes== | ==Usage notes== | ||
Line 19: | Line 19: | ||
The following statement returns ''''113:isprime = True''''. | The following statement returns ''''113:isprime = True''''. | ||
[[Intrinsic classes#printtext|printText]] {~} = {113:isprime} | [[Intrinsic classes#printtext|printText]] {~} = {113:isprime} | ||
The enumeration value is printed, above, as the result of an implicit | The enumeration value is printed, above, as the result of an implicit To<var>String</var> method call. | ||
==See also== | ==See also== |
Revision as of 15:49, 20 January 2011
Is this number prime? (Float class)
This intrinsic function returns a boolean value that indicates whether the method object value, rounded to an integer, is prime.
The method returns 'True' if number is prime, and it returns 'False' if it is not prime.
The IsPrime function is available as of version 7.3 of the Sirius Mods.
Syntax
%boolean = float:IsPrime
Syntax terms
%bool | An enumeration object of type Boolean to contain the returned value of IsPrime. |
---|---|
number | A Float value. |
Usage notes
- If number is a negative value or is greater than 231-1, the request is canceled.
Examples
The following statement returns '113:isprime = True'.
printText {~} = {113:isprime}
The enumeration value is printed, above, as the result of an implicit ToString method call.
See also
List of intrinsic Float methods