MDK::Common::Math man page on OpenMandriva

Man page or keyword search:  
man Server   8135 pages
apropos Keyword Search (all sections)
Output format
OpenMandriva logo
[printable version]

MDK::Common::Math(3)  User Contributed Perl Documentation MDK::Common::Math(3)

NAME
       MDK::Common::Math - miscellaneous math functions

SYNOPSIS
	   use MDK::Common::Math qw(:all);

EXPORTS
       $PI the well-known constant

       even(INT)
       odd(INT)
	   is the number even or odd?

       sqr(FLOAT)
	   sqr(3) gives 9

       sign(FLOAT)
	   returns a value in { -1, 0, 1 }

       round(FLOAT)
	   "round(1.2)" gives 1, "round(1.6)" gives 2

       round_up(FLOAT, INT)
	   returns the number rounded up to the modulo: "round_up(11,10)"
	   gives 20

       round_down(FLOAT, INT)
	   returns the number rounded down to the modulo: "round_down(11,10)"
	   gives 10

       divide(INT, INT)
	   integer division (which is lacking in perl). In array context, also
	   returns the remainder: "($a, $b) = divide(10,3)" gives "$a is 3"
	   and "$b is 1"

       min(LIST)
       max(LIST)
	   returns the minimum/maximum number in the list

       or_(LIST)
	   is there a true value in the list?

       and_(LIST)
	   are all values true in the list?

       sum(LIST)
       product(LIST)
	   returns the sum/product of all the element in the list

       factorial(INT)
	   factorial(4) gives 24 (4*3*2)

OTHER
       the following functions are provided, but not exported:

       factorize(INT)
	   "factorize(40)" gives "([2,3], [5,1])" as 40 = 2^3 + 5^1

       decimal2fraction(FLOAT)
	   "decimal2fraction(1.3333333333)" gives "(4, 3)" ($PRECISION is used
	   to decide which precision to use)

       poly2(a,b,c)
	   Solves the a*x2+b*x+c=0 polynomial: "poly2(1,0,-1)" gives "(1, -1)"

       permutations(n,p)
	   A(n,p)

       combinaisons(n,p)
	   C(n,p)

SEE ALSO
       MDK::Common

perl v5.16.3			  2011-04-11		  MDK::Common::Math(3)
[top]

List of man pages available for OpenMandriva

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net