Constants
This chapter describes some constants uniquely defined as macros in the C header mad_cst.h
and available from modules MAD.constant
and MAD._C
(C API) as floating point double precision variables.
Numerical Constants
These numerical constants are provided by the system libraries. Note that the constant huge
differs from math.huge
, which corresponds in fact to inf
.
MAD constants |
C macros |
C constants |
Values |
---|---|---|---|
|
|
|
Smallest representable step near one |
|
|
|
Smallest representable number |
|
|
|
Largest representable number |
|
|
|
Positive infinity, \(1/0\) |
|
|
|
Canonical NaN [1], \(0/0\) |
Mathematical Constants
This section describes some mathematical constants uniquely defined as macros in the C header mad_cst.h
and available from C and MAD modules as floating point double precision variables. If these mathematical constants are already provided by the system libraries, they will be used instead of their local definitions.
MAD constants |
C macros |
C constants |
Values |
---|---|---|---|
|
|
|
\(e\) |
|
|
|
\(\log_2(e)\) |
|
|
|
\(\log_{10}(e)\) |
|
|
|
\(\ln(2)\) |
|
|
|
\(\ln(10)\) |
|
|
|
\(\ln(\pi)\) |
|
|
|
\(\pi\) |
|
|
|
\(2\pi\) |
|
|
|
\(\pi/2\) |
|
|
|
\(\pi/4\) |
|
|
|
\(1/\pi\) |
|
|
|
\(2/\pi\) |
|
|
|
\(\sqrt 2\) |
|
|
|
\(\sqrt 3\) |
|
|
|
\(\sqrt{\pi}\) |
|
|
|
\(\sqrt{1/2}\) |
|
|
|
\(\sqrt{1/3}\) |
|
|
|
\(1/\sqrt{\pi}\) |
|
|
|
\(2/\sqrt{\pi}\) |
|
|
|
\(180/\pi\) |
|
|
|
\(\pi/180\) |
Physical Constants
This section describes some physical constants uniquely defined as macros in the C header mad_cst.h
and available from C and MAD modules as floating point double precision variables.
MAD constants |
C macros |
C constants |
Values |
---|---|---|---|
|
|
|
Min length tolerance, default \(10^{-10}\) in [m] |
|
|
|
Min angle tolerance, default \(10^{-10}\) in [1/m] |
|
|
|
Min strength tolerance, default \(10^{-10}\) in [rad] |
The following table lists some physical constants from the CODATA 2018 sheet.
MAD constants |
C macros |
C constants |
Values |
---|---|---|---|
|
|
|
Speed of light, \(c\) in [m/s] |
|
|
|
Permeability of vacuum, \(\mu_0\) in [T.m/A] |
|
|
|
Permittivity of vacuum, \(\epsilon_0\) in [F/m] |
|
|
|
Elementary electric charge, \(e\) in [C] |
|
|
|
Reduced Plack’s constant, \(\hbar\) in [GeV.s] |
|
|
|
Unified atomic mass, \(m_u\,c^2\) in [GeV] |
|
|
|
Electron mass, \(m_e\,c^2\) in [GeV] |
|
|
|
Proton mass, \(m_p\,c^2\) in [GeV] |
|
|
|
Neutron mass, \(m_n\,c^2\) in [GeV] |
|
|
|
Muon mass, \(m_{\mu}\,c^2\) in [GeV] |
|
|
|
Deuteron mass, \(m_d\,c^2\) in [GeV] |
|
|
|
Classical electron radius, \(r_e\) in [m] |
|
|
|
Fine-structure constant, \(\alpha\) |
Footnotes