math(3tcl)
๐ NAME ๐
math โ the Tcl Math Library, aka your new bestie for numbers ๐
โจ SYNOPSIS โจ
package require Tcl 8.5 9
package require math ?1.2.6?
::math::cov value value ?value ...?
::math::integrate list of xy value pairs
::math::fibonacci n
::math::max value ?value ...?
::math::mean value ?value ...?
::math::min value ?value ...?
::math::product value ?value ...?
::math::random ?value1? ?value2?
::math::sigma value value ?value ...?
::math::stats value value ?value ...?
::math::sum value ?value ...?
๐ธ DESCRIPTION ๐ธ
okay so the math package is literally just a lil bundle of utility math functions. that's the vibe. ๐งฎโจ
and like, besides the basic set of commands you get straight from the math package, there are also a whole bunch of more specialised packages, and honestly? iconic lineup:
math::bigfloatโ Arbitrary-precision floating-point arithmeticmath::bignumโ Arbitrary-precision integer arithmeticmath::calculus::rombergโ Robust integration methods for functions of one variable, using Romberg integrationmath::calculusโ Integration of functions, solving ordinary differential equationsmath::combinatoricsโ Procedures for various combinatorial functions (for instance the Gamma function and "k out of n")math::complexnumbersโ Complex number arithmeticmath::constantsโ A set of well-known mathematical constants, such as Pi, E, and the golden ratiomath::fourierโ Discrete Fourier transformsmath::fuzzyโ Fuzzy comparisons of floating-point numbersmath::geometryโ 2D geometrical computationsmath::interpolateโ Various interpolation methodsmath::linearalgebraโ Linear algebra packagemath::optimizeโ Optimization methodsmath::polynomialsโ Polynomial arithmetic (includes families of classical polynomials)math::rationalfunctionsโ Arithmetic of rational functionsmath::romanโ Manipulation (including arithmetic) of Roman numeralsmath::specialโ Approximations of special functions from mathematical physicsmath::statisticsโ Statistical operations and tests
no cap, that's a whole squad ๐ซถ
๐ BASIC COMMANDS ๐
the main character commands, fr fr:
::math::cov value value ?value ...?โ gives you the coefficient of variation expressed as percent of two or more numeric values ๐ฏ::math::integrate list of xy value pairsโ gives you the area under a "curve" defined by a set of x,y pairs, plus the error bound, all as a list ๐ฆ::math::fibonacci nโ gives you the n'th Fibonacci number, yes the sequence, you know the one ๐::math::max value ?value ...?โ the maximum of one or more numeric values ๐::math::mean value ?value ...?โ the mean, or "average", of one or more numeric values ๐::math::min value ?value ...?โ the minimum of one or more numeric values ๐ฅบ::math::product value ?value ...?โ the product of one or more numeric values โ๏ธ::math::random ?value1? ?value2?โ a random number, and the vibe depends on how many args you pass:- no arguments โ a floating point value between 0 and 1 ๐ฒ
- one argument โ an integer value between 0 and value1
- two arguments โ an integer value between value1 and value2
::math::sigma value value ?value ...?โ the sample standard deviation of two or more numeric values ๐::math::stats value value ?value ...?โ the mean, standard deviation, and coefficient of variation (as percent), served up as a list โญ::math::sum value ?value ...?โ the sum of one or more numeric values โ
๐ BUGS, IDEAS, FEEDBACK ๐
ngl, this document, and the package it describes, will undoubtedly contain bugs and other problems. like, that's just how it is ๐ญ please report such in the category math of the Tcllib Trackers [http://core.tcl.tk/tcllib/reportlist]. and please also report any ideas for enhancements you may have for either package and/or documentation โ we love ideas, bestie ๐ซถ
when proposing code changes, please provide unified diffs, i.e the output of diff -u.
also note further that attachments are strongly preferred over inlined patches. attachments can be made by going to the Edit form of the ticket immediately after its creation, and then using the left-most button in the secondary navigation bar. yes, that specific button. the left-most one. go off ๐
๐ KEYWORDS ๐
math, statistics
๐ CATEGORY ๐
Mathematics
and that's the whole page, periodt โจ this was math(3tcl) from the Tcl Math Library, brought to you by tcllib version 1.2.6 โ date stamped and everything, ily, go do some math bestie ๐๐ง๐ธ
๐ฆ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 ยท Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 ยท Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 ยท Tcl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms