gives the Cantor staircase function .


  • The Cantor staircase function is also known as Cantor ternary function or Cantor function.
  • Mathematical function, suitable for both symbolic and numeric manipulation.
  • For , the Cantor function equals TemplateBox[{x}, CantorStaircase]=sum_i2^(-n_i).
  • For certain arguments, CantorStaircase automatically evaluates to exact values.
  • CantorStaircase can be evaluated to arbitrary numerical precision.
  • CantorStaircase automatically threads over lists.


open allclose all

Basic Examples  (2)

Evaluate at a point in the Cantor set:

Plot CantorStaircase over the unit interval:

Scope  (13)

Numerical Evaluation  (5)

Evaluate numerically:

Evaluate with integer inputs:

Evaluate at rational numbers:

Evaluate at high precision:

CantorStaircase threads elementwise over lists and matrices:

Function Properties  (8)

CantorStaircase is defined for all real numbers:

Its domain is restricted to real inputs:

The range of CantorStaircase:

Since its range is bounded, it is not surjective:

CantorStaircase is not injective:

CantorStaircase is continuous:

CantorStaircase is nondecreasing:

CantorStaircase is non-negative:

CantorStaircase is neither convex nor concave:

TraditionalForm formatting:

Wolfram Research (2014), CantorStaircase, Wolfram Language function,


Wolfram Research (2014), CantorStaircase, Wolfram Language function,


Wolfram Language. 2014. "CantorStaircase." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2014). CantorStaircase. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2021_cantorstaircase, author="Wolfram Research", title="{CantorStaircase}", year="2014", howpublished="\url{}", note=[Accessed: 17-January-2022 ]}


@online{reference.wolfram_2021_cantorstaircase, organization={Wolfram Research}, title={CantorStaircase}, year={2014}, url={}, note=[Accessed: 17-January-2022 ]}