IsPrime (Float function): Difference between revisions
Jump to navigation
Jump to search
m (→Examples) |
mNo edit summary |
||
Line 25: | Line 25: | ||
[[Category: Intrinsic methods]] | [[Category: Intrinsic methods]] | ||
[[Category:System methods]] | [[Category:System methods]] | ||
<!-- | |||
<section begin=dpl_desc /> | |||
Determine if number is prime | |||
<section end=dpl_desc /> | |||
--> |
Revision as of 12:29, 22 December 2010
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.
IsPrime syntax
%bool = number: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