Mathematical Constants#

Degree#

property ctx.degree#

where ctx is math53, ctxboost or ctxflint.

Returns one degree of angle, \(1^{\circ} = \pi/180\). See also Wikipedia [1380], MathWorld [975], Mpmath [634], Mpmath [762], Mpmath [751].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstDegree()
xreal('1.7453292519943295769E-2')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstDegree()
0.0174532925199433

Golden ratio phi#

property ctx.phi#

where ctx is math53, ctxboost or ctxflint.

Returns the golden ratio \(\phi = (1+\sqrt 5)/2\). See also Wikipedia [1387], MathWorld [978], Mpmath [641].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstPhi()
xreal('1.6180339887498948482')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstPhi()
1.61803398874989

Natural logarithm of 2#

property ctx.ln2#

where ctx is math53, ctxboost or ctxflint.

Returns the logarithm of 2. See also Wikipedia [1371], MathWorld [983].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstLog2()
xreal('6.9314718055994530943E-1')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstLog2()
0.693147180559945

Natural logarithm of 10#

property ctx.ln10#

where ctx is math53, ctxboost or ctxflint.

Returns the logarithm of 10. See also MathWorld [982].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstLog10()
xreal('2.3025850929940456840')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstLog10()
2.30258509299405

Pi (\(\pi\))#

property ctx.pi#

where ctx is math53, ctxboost or ctxflint.

Returns the constant pi. See also Wikipedia [1372], MathWorld [984], Mpmath [646].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.Pi()
xreal('3.1415926535897932385')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.Pi()
3.14159265358979

Euler e#

property ctx.e#

where ctx is math53, ctxboost or ctxflint.

Returns the constant const_e. See also Wikipedia [1376], MathWorld [985], Mpmath [631].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstE()
xreal('3.1415926535897932385')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstE()
2.71828182845905

Euler-Mascheroni constant \(\gamma\)#

property ctx.egamma#

where ctx is math53, ctxboost or ctxflint.

Returns the Euler gamma constant. See also Wikipedia [1385], MathWorld [976], Mpmath [639].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstEulerGamma()
xreal('5.7721566490153286062E-1')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstEulerGamma()
0.577215664901533

Apéry’s constant#

property ctx.apery#

where ctx is math53, ctxboost or ctxflint.

Represents Apery’s constant. See also Wikipedia [1377], MathWorld [970], Mpmath [629].

It is an irrational number approximately equal to 1.2020569 given by

\[\zeta(3) = \sum_{k=1}^\infty\frac{1}{k^3}.\]

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstApery()
xreal('1.2020569031595942854')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstApery()
1.20205690315959

Catalan’s constant#

property ctx.catalan#

where ctx is math53, ctxboost or ctxflint.

Returns the Catalan constant. See also Wikipedia [1388], MathWorld [971], Mpmath [633].

Catalan’s constant \(K\) = 0.91596559… is given by the infinite series

\[K = \sum_{k=0}^{\infty} \frac{(-1)^k}{(2k+1)^2}.\]

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstCatalan()
xreal('9.1596559417721901505E-1')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstCatalan()
0.915965594177219

Glaisher’s constant#

property ctx.glaisher#

where ctx is math53, ctxboost or ctxflint.

Returns Glaisher’s constant. See also Wikipedia [1386], MathWorld [977], Mpmath [640].

The constant is defined as \(A = \exp(1/12-\zeta'(-1))\) where \(\zeta'(s)\) denotes the derivative of the Riemann zeta function.

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstGlaisher()
xreal('1.2824271291006226369')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstGlaisher()
1.28242712910062

Khinchin’s constant#

property ctx.khinchin#

where ctx is math53, ctxboost or ctxflint.

Returns Khinchin’s constant. See also Wikipedia [1393], MathWorld [979], Mpmath [645].

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstKhinchin()
xreal('2.6854520010653064454')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstKhinchin()
2.68545200106531

Imaginary One#

property ctx.onei#

where ctx is math53, ctxboost or ctxflint.

Returns the imaginary unit.

In extended precision (32 bit version of xlcalcnet)

>>> from xlcalcnet import xreal
>>> xreal.ConstDegree()
xreal('1.7453292519943295769E-2')

In double precision (64 bit version of xlcalcnet)

>>> from xlcalcnet import Gpr
>>> Gpr.ConstDegree()
0.0174532925199433