RunMat
  • Pricing
RunMat
GitHub
GitHub
DownloadSign InTry in Browser
DesktopRuntimeServer
RunMat

Run math blazing fast

GitHubX (Twitter)LinkedIn

Company

  • About
  • Pricing
  • Contact

Explore

  • RunMat for academia
  • RunMat vs MATLAB Online
  • Benchmarks

Get product updates and release notes from the RunMat team.

© 2026 Dystr · Made withfor the scientific community.

RunMat™ is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

LicensePrivacy
/
See all docs
Builtin Reference
    • digits
    • int
    • limit
    • piecewise
    • sym
    • syms
    • vpa

limit — Evaluate scalar symbolic limits by substitution and L'Hopital reduction.

limit evaluates scalar symbolic expressions at a finite numeric point. It first performs direct substitution and simplification, then applies repeated L'Hopital reduction for removable 0/0 quotients.

Syntax

L = limit(expr, var, point, direction)

Inputs

NameTypeRequiredDefaultDescription
exprAnyYes—Scalar symbolic expression.
varAnyNo—Limit variable. Inferred when omitted and the expression has one variable.
pointAnyNo0Numeric point approached by the limit variable.
directionStringScalarNo—Optional left or right direction.

Returns

NameTypeDescription
LAnyScalar symbolic or numeric limit result.

Errors

IdentifierWhenMessage
RunMat:limit:InvalidExpressionThe expression cannot be represented as a scalar symbolic expression.limit: expected a scalar symbolic or numeric expression
RunMat:limit:InvalidVariableThe limit variable cannot be inferred or is not a symbolic variable/text scalar.limit: invalid or ambiguous symbolic variable
RunMat:limit:InvalidPointThe limit point is not a finite scalar numeric value.limit: expected a finite scalar numeric point
RunMat:limit:InvalidDirectionThe optional direction is not left, right, +, or -.limit: invalid direction
RunMat:limit:UnsupportedThe scalar symbolic limit cannot be resolved by substitution or L'Hopital reduction.limit: unable to resolve symbolic limit
RunMat:limit:ArgCountToo many arguments were supplied.limit: too many input arguments

How limit works

  • Supports limit(expr), limit(expr, point), limit(expr, var), limit(expr, var, point), and an optional direction string. MATLAB-compatible calls require a symbolic expression; RunMat mode independently admits scalar numeric expressions.
  • All eight integer classes are accepted for a numeric limit point and, in RunMat mode, a numeric expression. Native storage is read directly and values that cannot enter the current binary64 symbolic core exactly are rejected before substitution.
  • Infers the limit variable when the expression contains exactly one symbolic variable.
  • Simplifies symbolic arithmetic involving +, -, *, /, powers with numeric exponents, and the functions sin, cos, tan, exp, log, and sqrt.
  • Returns scalar symbolic values, including symbolic constants when the limit simplifies to a finite value.
  • One-sided directions are accepted as left, right, -, or + for simple pole detection.

Examples

Classic sinc limit

syms x
f = limit(sin(x)/x, x, 0)

Finite-difference derivative limit

syms x h
f = limit((cos(x+h) - cos(x))/h, h, 0)

Fractional symbolic power limit

syms x
f = limit((cos(x)^(1/3) - 1) / x^2, x, 0)

Using limit with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how limit changes the result.

Run a small limit example, explain the result, then change one input and compare the output.

FAQ

Does limit implement the full Symbolic Math Toolbox?⌄

No. It implements RunMat's scalar symbolic expression core for common calculus expressions used in MATLAB scripts.

Related Math functions

Symbolic

digits · int · piecewise · sym · syms · vpa

Elementwise

abs · angle · bsxfun · complex · conj · double · erf · erfcinv · exp · expm1 · factorial · flintmax · gamma · gammaln · heaviside · hypot · idivide · imag · intmax · intmin · ldivide · log · log10 · log1p · log2 · minus · nextpow2 · plus · pow2 · power · rdivide · real · realmax · realmin · realsqrt · rescale · sign · single · sqrt · swapbytes · times · typecast · uint16 · uint32 · uint8

Trigonometry

acos · acosh · asin · asinh · atan · atan2 · atanh · cos · cosd · cosh · cospi · deg2rad · pol2cart · rad2deg · sin · sind · sinh · sinpi · tan · tand · tanh

Reduction

all · any · bounds · cummax · cummin · cumprod · cumsum · cumtrapz · diff · gradient · max · maxk · mean · median · min · mink · movmax · movmean · movmedian · movmin · movprod · movstd · movsum · movvar · nnz · prod · rms · std · sum · trapz · var

Structure

bandwidth · isdiag · ishermitian · issymmetric · istril · istriu · symrcm

Signal

blackman · butter · buttord · cheb2ord · conv · conv2 · deconv · downsample · envelope · filter · filtfilt · fir1 · freqz · gauspuls · hamming · hann · hilbert · periodogram · pulstran · pwelch · rectpuls · resample · sawtooth · sinc · spectrogram · square · tripuls · unwrap · upsample · zplane

Rounding

ceil · fix · floor · mod · rem · round

Factor

chol · decomposition · eig · eigs · lu · qr · svd

Solve

cond · det · inv · linsolve · norm · null · pinv · rank · rcond · rref · vecnorm

Optim

coneprog · fminbnd · fminunc · fsolve · fzero · integral · linprog · lsqcurvefit · lsqnonlin · optimoptions · optimset · quad · secondordercone

Ops

cross · ctranspose · dot · mldivide · mpower · mrdivide · mtimes · pagemtimes · pagetranspose · trace · transpose

Fft

fft · fft2 · fftn · fftshift · ifft · ifft2 · ifftn · ifftshift

Interpolation

griddedInterpolant · interp1 · interp1q · interp2 · pchip · ppval · spline

Discrete

lcm · primes

Ode

ode15s · ode23 · ode45

Poly

polyder · polyfit · polyint · polyval · roots

Open-source implementation

Unlike proprietary runtimes, every RunMat function is open-source. Read exactly how limit is executed, line by line, in Rust.

  • View the source for limit in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is an open-source runtime that executes MATLAB-syntax code blazing on any GPU. It is licensed under the Apache 2.0 license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • How limit works
  • Examples
  • Classic sinc limit
  • Finite-difference derivative limit
  • Fractional symbolic power limit
  • Using limit with coding agents
  • FAQ
  • Related Math functions
  • Symbolic
  • Elementwise
  • Trigonometry
  • Reduction
  • Structure
  • Signal
  • Rounding
  • Factor
  • Solve
  • Optim
  • Ops
  • Fft
  • Interpolation
  • Discrete
  • Ode
  • Poly
  • Open-source implementation
  • About RunMat