User Tools

Site Tools





This website is sponsored by


This wiki uses icons from licensed under CC BY-ND 3.0.


This is an old revision of the document!

Author Patrick Lehmann
Last Update 26.08.2016
Related Proposals

Mathematical Functions

Regular structures like sorting networks need helper functions to calculate the bound for for…generate statements. This packages offers common mathematical functions like gcd, lcm or triangual number.

package math is
  -- figurate numbers
  function squareNumber(N : positive) return positive;
  function cubicNumber(N : positive) return positive;
  function triangularNumber(N : natural) return natural;
  -- coefficients
  -- binomial coefficient (N choose K)
  function binomialCoefficient(N : positive; K : positive) return positive;
  -- greatest common divisor (gcd)
  function greatestCommonDivisor(N1 : positive; N2 : positive) return positive;
  -- least common multiple (lcm)
  function leastCommonMultiple(N1 : positive; N2 : positive) return positive;
end package;

Source: PoC.math

General Comments

  • None at this time


proposals/helper/pocmath.1473796257.txt.gz · Last modified: 13.09.2016 19:50 by paebbels