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
Arguments are validated before the mathematical operation runs. Domain-sensitive functions reject impossible inputs explicitly:
Decimal arguments accept a dot; a single comma is also normalized as a decimal separator. pi, e, inf, -inf and nan can be supplied where a numeric argument is expected. Base conversion accepts unsigned integers and bases from 2 through 36.
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 abs -88math clamp 120 0 100100math round 12.3456 212.35math sqrt 819math sqrt -1Domain errormath intdiv 17 53math intdiv 8 0Division by zeromath log 1000 103math sin 00math sin 10.841470984807897math asin 2Domain errormath deg2rad 1803.14159265358979math base_convert 1010 2 16amath dechex 255ffExpands the local reference so every mathematical function has its own discoverable line.