Install the complete package with local command reference and every published mode.
install mathmathThis is not an expression evaluator: name a function first, then pass its arguments. Domain and division checks are explicit, and trigonometric functions use radians; use deg2rad or rad2deg when working with degrees.
math <function> [args]math pishow mathematical constants pi or e
math eshow mathematical constants pi or e
math infshow special floating-point values
math nanshow special floating-point values
math abs <n>absolute value or sign of one number
math sign <n>absolute value or sign of one number
math min <numbers>minimum or maximum of one or more numbers
math max <numbers>minimum or maximum of one or more numbers
math clamp <value> <min> <max>limit a value to the selected range
math ceil <n>round upward or downward
math floor <n>round upward or downward
math round <n> [precision]round with optional decimal precision
math pow <base> <exponent>raise a number to a power
math fpow <base> <exponent>raise a number to a power
math sqrt <n>square or cube root
math cbrt <n>square or cube root
math exp <n>exponential functions
math expm1 <n>exponential functions
math hypot <x> <y>hypotenuse from two components
math intdiv <a> <b>integer division
math fdiv <a> <b>IEEE 754 floating-point division
math fmod <a> <b>floating-point remainder
math log <n> [base]natural or selected-base logarithm
math log10 <n>base-10 logarithm or log(1+n)
math log1p <n>base-10 logarithm or log(1+n)
math sin <rad>trigonometric functions in radians
math cos <rad>trigonometric functions in radians
math tan <rad>trigonometric functions in radians
math asin <n>inverse trigonometric functions
math acos <n>inverse trigonometric functions
math atan <n>inverse trigonometric functions
math atan2 <y> <x>angle from two Cartesian components
math sinh <n>hyperbolic functions
math cosh <n>hyperbolic functions
math tanh <n>hyperbolic functions
math asinh <n>inverse hyperbolic functions
math acosh <n>inverse hyperbolic functions
math atanh <n>inverse hyperbolic functions
math deg2rad <n>convert degrees and radians
math rad2deg <n>convert degrees and radians
math is_finite <n>inspect special floating-point values
math is_infinite <n>inspect special floating-point values
math is_nan <n>inspect special floating-point values
math base_convert <number> <from> <to>convert an unsigned integer between bases 2–36
math bindec <number>convert binary, hexadecimal or octal to decimal
math hexdec <number>convert binary, hexadecimal or octal to decimal
math octdec <number>convert binary, hexadecimal or octal to decimal
math decbin <number>convert decimal to binary, hexadecimal or octal
math dechex <number>convert decimal to binary, hexadecimal or octal
math decoct <number>convert decimal to binary, hexadecimal or octal
The first argument names the function; subsequent arguments are numbers in its documented order. Angles for sin, cos, tan and inverse trigonometric functions use radians; convert with deg2rad and rad2deg. round accepts an optional precision;
Inputs are validated: a negative square root, division by zero or logarithm with base 1 returns an error. Results use floating-point arithmetic; rounding and large values have finite precision. Decimal numbers use a dot (a single comma is accepted). pi, e, inf and nan are special tokens, not variables or a general expression language.
Run the prepared examples directly on the page. Their results are prebuilt and shown in the browser; no terminal command is executed on the server.
Install the current compatible version. Choose Base for the complete feature set or Minimum for the reduced package; use upgrade to update a module that is already installed.
Base and Minimum are two packages of the same current module release, not separate command versions.
Install the complete package with local command reference and every published mode.
install mathInstall the reduced package. Local reference is omitted;
install math -mInstall exactly this published version.
install math -v 1.1.4Ask upgrade to check compatibility and replace the installed block only when needed.
upgrade mathRemove the extension block while leaving the core and unrelated modules intact.
install math -uExamples are copyable command lines, not actions executed by this website. Review paths, permissions and destructive flags before running them on a real project.
math pi3.14159265358979math e2.71828182845905math infINFmath nanNANmath abs -88math sign -8-1math min 9 2 42math max 9 2 49math clamp 120 0 100100math ceil 12.113math floor 12.912math round 12.3456 212.35math pow 2 8256math fpow 2 38math sqrt 819math cbrt -27-3math exp 12.71828182845905math expm1 0.10.105170918075648math hypot 3 45math intdiv 17 53math fdiv 7 23.5math fmod 17 52math log 1000 103math log10 10003math log1p 10.693147180559945math sin 00math cos 01math tan 00math asin 0.50.523598775598299math acos 10math atan 10.785398163397448math atan2 1 10.785398163397448math sinh 11.1752011936438math cosh 11.54308063481524math tanh 10.761594155955765math asinh 10.881373587019543math acosh 21.31695789692482math atanh 0.50.549306144334055math deg2rad 1803.14159265358979math rad2deg pi180math is_finite 10truemath is_infinite inftruemath is_nan nantruemath base_convert 1010 2 16amath bindec 101010math hexdec ff255math octdec 1715math decbin 101010math dechex 255ffmath decoct 1517math sqrt -1Domain errormath intdiv 8 0Division by zeromath log 10 1Invalid basemath asin 2Domain errormath round 12 20Invalid precisionmath base_convert 102 2 16Invalid digit for source basemath pow 0 -1Division by zeromath round 12,35 112.4math mystery 3Unknown math functionmath clamp 5 10 0Invalid rangeExpands the local reference so every mathematical function has its own discoverable line.