Difference between pages "Commgroup" and "Getprime"

From Mesham
(Difference between pages)
Jump to navigationJump to search
m
 
m (4 revisions imported)
 
Line 1: Line 1:
== Syntax ==
+
== Overview ==
  
commgroup[process list]
+
This getprime(n) function will find the ''n''th prime number.
  
== Semantics ==
+
* '''Pass:''' An [[Int]]
 
+
* '''Returns:''' An [[Int]] representing the prime
Specified within the multiple type, will limit memory allocation (and variable communication) to the processes within the list given in this type's arguments. This type will ensure that the communications group processes exist.
 
  
 
== Example ==
 
== Example ==
  
  var i:Int :: allocated[multiple[commgroup[1,3]]];
+
  #include <maths>
 +
 +
function void main() {
 +
    var a:=getprime(10);
 +
    var y:=getprime(a);
 +
};
  
In this example there are a number processes, but only 1 and 3 have variable ''i'' allocated to them. This type would have also ensured that process two (and zero) exists for there to be a process three.
+
''Since: Version 0.41b''
  
[[Category:Type Library]]
+
[[Category:Function Library]]
[[Category:Compound Types]]
+
[[Category:Maths Functions]]
[[Category:Allocation Types]]
 

Latest revision as of 15:44, 15 April 2019

Overview

This getprime(n) function will find the nth prime number.

  • Pass: An Int
  • Returns: An Int representing the prime

Example

#include <maths>

function void main() {
   var a:=getprime(10);
   var y:=getprime(a);
};

Since: Version 0.41b