IsPrime (Float function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (Apply Jim;s comments; still some unfound / missing links)
m (printtext)
Line 19: Line 19:
==Examples==
==Examples==
<ol><li>The following statement returns '<code>113:isprime = True</code>'.
<ol><li>The following statement returns '<code>113:isprime = True</code>'.
<p class="code">printText {~} = {113:isprime}
<p class="code">[[PrintText statement|printText]] {~} = {113:isprime}
</p>
</p>
The enumeration value is printed, above, as the result of an implicit <var>[[ToString property)|ToString]]</var> property call.</ol>
The enumeration value is printed, above, as the result of an implicit <var>[[ToString property)|ToString]]</var> property call.</ol>


==See also==
==See also==
<ul><li>For details of the <var>printtext</var> statement, please see <var>[[Intrinsic classes#printtext|printText]]</var>.</ul>
{{Template:Float:IsPrime footer}}
{{Template:Float:IsPrime footer}}

Revision as of 11:44, 22 February 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

  1. 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.

See also