1[manpage_begin math n 1.2.5]
2[comment {-*- tcl -*- doctools manpage}]
3[moddesc   {Tcl Math Library}]
4[titledesc {Tcl Math Library}]
5[category  Mathematics]
6[require Tcl 8.2]
7[require math [opt 1.2.5]]
8[description]
9[para]
10
11The [package math] package provides utility math functions.
12[para]
13Besides a set of basic commands, available via the package [emph math],
14there are more specialised packages:
15
16[list_begin itemized]
17[item]
18[package math::bigfloat] - Arbitrary-precision floating-point
19arithmetic
20[item]
21[package math::bignum] - Arbitrary-precision integer arithmetic
22[item]
23[package math::calculus::romberg] - Robust integration methods for
24functions of one variable, using Romberg integration
25[item]
26[package math::calculus] - Integration of functions, solving ordinary
27differential equations
28[item]
29[package math::combinatorics] - Procedures for various combinatorial
30functions (for instance the Gamma function and "k out of n")
31[item]
32[package math::complexnumbers] - Complex number arithmetic
33[item]
34[package math::constants] - A set of well-known mathematical
35constants, such as Pi, E, and the golden ratio
36[item]
37[package math::fourier] - Discrete Fourier transforms
38[item]
39[package math::fuzzy] - Fuzzy comparisons of floating-point numbers
40[item]
41[package math::geometry] - 2D geometrical computations
42[item]
43[package math::interpolate] - Various interpolation methods
44[item]
45[package math::linearalgebra] - Linear algebra package
46[item]
47[package math::optimize] - Optimization methods
48[item]
49[package math::polynomials] - Polynomial arithmetic (includes families
50of classical polynomials)
51[item]
52[package math::rationalfunctions] - Arithmetic of rational functions
53[item]
54[package math::roman] - Manipulation (including arithmetic) of Roman
55numerals
56[item]
57[package math::special] - Approximations of special functions from
58mathematical physics
59[item]
60[package math::statistics] - Statistical operations and tests
61[list_end]
62
63[section "BASIC COMMANDS"]
64
65[list_begin definitions]
66
67[call [cmd ::math::cov] [arg value] [arg value] [opt [arg {value ...}]]]
68
69Return the coefficient of variation expressed as percent of two or
70more numeric values.
71
72
73[call [cmd ::math::integrate] [arg {list of xy value pairs}]]
74
75Return the area under a "curve" defined by a set of x,y pairs and the
76error bound as a list.
77
78
79[call [cmd ::math::fibonacci] [arg n]]
80
81Return the [arg n]'th Fibonacci number.
82
83
84[call [cmd ::math::max] [arg value] [opt [arg {value ...}]]]
85
86Return the maximum of one or more numeric values.
87
88
89[call [cmd ::math::mean] [arg value] [opt [arg {value ...}]]]
90
91Return the mean, or "average" of one or more numeric values.
92
93
94[call [cmd ::math::min] [arg value] [opt [arg {value ...}]]]
95
96Return the minimum of one or more numeric values.
97
98
99[call [cmd ::math::product] [arg value] [opt [arg {value ...}]]]
100
101Return the product of one or more numeric values.
102
103
104[call [cmd ::math::random] [opt [arg value1]] [opt [arg value2]]]
105
106Return a random number.  If no arguments are given, the number is a
107floating point value between 0 and 1.  If one argument is given, the
108number is an integer value between 0 and [arg value1].  If two
109arguments are given, the number is an integer value between
110
111[arg value1] and [arg value2].
112
113
114[call [cmd ::math::sigma] [arg value] [arg value] [opt [arg {value ...}]]]
115
116Return the population standard deviation of two or more numeric
117values.
118
119
120[call [cmd ::math::stats] [arg value] [arg value] [opt [arg {value ...}]]]
121
122Return the mean, standard deviation, and coefficient of variation (as
123percent) as a list.
124
125
126[call [cmd ::math::sum] [arg value] [opt [arg {value ...}]]]
127
128Return the sum of one or more numeric values.
129
130[list_end]
131
132[section {BUGS, IDEAS, FEEDBACK}]
133
134This document, and the package it describes, will undoubtedly contain
135bugs and other problems.
136
137Please report such in the category [emph math] of the
138[uri {http://sourceforge.net/tracker/?group_id=12883} {Tcllib SF Trackers}].
139
140Please also report any ideas for enhancements you may have for either
141package and/or documentation.
142
143
144[keywords math statistics]
145[manpage_end]
146