Difference between revisions of "Mod"

From Mesham
Jump to navigationJump to search
(Created page with '== Overview == This mod[n,x] function will divide ''n'' by ''x'' and return the remainder. * '''Pass:''' Two integers * '''Returns:''' An integer representing the remainder ==…')
 
m (4 revisions imported)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Overview ==
 
== Overview ==
  
This mod[n,x] function will divide ''n'' by ''x'' and return the remainder.
+
This mod(n,x) function will divide ''n'' by ''x'' and return the remainder.
  
 
* '''Pass:''' Two integers
 
* '''Pass:''' Two integers
Line 8: Line 8:
 
== Example ==
 
== Example ==
  
  var a:=mod[7,2];
+
  #include <maths>
var y;
+
y:=mod[a,a];
+
function void main() {
 +
    var a:=mod(7,2);
 +
    var y:=mod(a,a);
 +
};
 +
 
 +
''Since: Version 0.41b''
  
 
[[Category:Function Library]]
 
[[Category:Function Library]]
 
[[Category:Maths Functions]]
 
[[Category:Maths Functions]]

Latest revision as of 15:44, 15 April 2019

Overview

This mod(n,x) function will divide n by x and return the remainder.

  • Pass: Two integers
  • Returns: An integer representing the remainder

Example

#include <maths>

function void main() {
   var a:=mod(7,2);
   var y:=mod(a,a);
};

Since: Version 0.41b