NextPrime (Float function): Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 32: | Line 32: | ||
[[Category: Intrinsic methods]] | [[Category: Intrinsic methods]] | ||
[[Category:System methods]] | [[Category:System methods]] | ||
<!-- | |||
<section begin=dpl_desc /> | |||
Find next prime number | |||
<section end=dpl_desc /> | |||
--> |
Revision as of 12:31, 22 December 2010
This intrinsic function returns the next prime number after the method object value.
The NextPrime function is available as of version 7.3 of the Sirius Mods.
NextPrime syntax
%value = number:NextPrime
Syntax terms
- %value
- A numeric variable to receive the method result.
- number
- A Float value.
Usage Notes
- The method object value is initially rounded to the nearest integer before the next prime is determined.
- NextPrime always returns a value higher than the method object value, even if the method object value is prime.
- If number is a negative value or is greater than 231-1, the request is cancelled.
Examples
The following request displays the first one hundred prime numbers after 1000:
b %i is float %n is float %n = 1000 for %i from 1 to 100 %n = %n:nextPrime printText {%n} end for end
See also
List of Intrinsic Float Methods