Difference between revisions of "Getprime"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This getprime[n] function will find the ''n''th prime number. * '''Pass:''' An integer * '''Returns:''' An integer representing the prime == Example == var a:=…')
 
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This getprime[n] function will find the ''n''th prime number.
+
This getprime(n) function will find the ''n''th prime number.
 +
 
 
* '''Pass:''' An integer
 
* '''Pass:''' An integer
 
* '''Returns:''' An integer representing the prime
 
* '''Returns:''' An integer representing the prime
Line 7: Line 8:
 
== Example ==
 
== Example ==
  
  var a:=getprime[10];
+
#include <maths>
  var y;
+
  var a:=getprime(10);
y:=getprime[a];
+
  var y:=getprime(a);
  
 
[[Category:Function Library]]
 
[[Category:Function Library]]
 
[[Category:Maths Functions]]
 
[[Category:Maths Functions]]

Revision as of 12:48, 13 January 2013

Overview

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

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

Example

#include <maths>
var a:=getprime(10);
var y:=getprime(a);