File indexing completed on 2024-05-12 17:22:30

0001 // This file is part of the SpeedCrunch project
0002 // Copyright (C) 2007 Ariya Hidayat <ariya@kde.org>
0003 // Copyright (C) 2007, 2009, 2011, 2013, 2016 @heldercorreia
0004 // Copyright (C) 2009 Andreas Scherer <andreas_coder@freenet.de>
0005 // Copyright (C) 2016 Hadrien Theveneau <theveneau@gmail.com>
0006 //
0007 // This program is free software; you can redistribute it and/or
0008 // modify it under the terms of the GNU General Public License
0009 // as published by the Free Software Foundation; either version 2
0010 // of the License, or (at your option) any later version.
0011 //
0012 // This program is distributed in the hope that it will be useful,
0013 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0015 // GNU General Public License for more details.
0016 //
0017 // You should have received a copy of the GNU General Public License
0018 // along with this program; see the file COPYING.  If not, write to
0019 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0020 // Boston, MA 02110-1301, USA.
0021 
0022 #include "constants.h"
0023 
0024 #include "numberformatter.h"
0025 #include "hmath.h"
0026 
0027 #include <KLocalizedString>
0028 
0029 #include <QCoreApplication>
0030 
0031 #include <algorithm>
0032 
0033 static Constants* s_constantsInstance = nullptr;
0034 
0035 static void s_deleteConstants()
0036 {
0037     delete s_constantsInstance;
0038 }
0039 
0040 struct Constants::Private
0041 {
0042     QStringList categories;
0043     QList<Constant> list;
0044 
0045     void populate();
0046     void retranslateText();
0047 };
0048 
0049 // UNCERTAINTY  and CHECKEC reserved for future use
0050 #define PUSH_CONSTANT_CODATA(NAME,VALUE,UNIT,UNCERTAINTY,CHECKED) \
0051     c.value = QLatin1String(VALUE); \
0052     c.unit  = QString::fromUtf8(UNIT); \
0053     list << c;
0054 
0055 #define PUSH_CONSTANT(NAME,VALUE,UNIT) \
0056     c.value = QLatin1String(VALUE); \
0057     c.unit  = QString::fromUtf8(UNIT); \
0058     list << c;
0059 
0060 #define PUSH_CONSTANT_NO_UNIT(NAME,VALUE) \
0061     c.value = QLatin1String(VALUE); \
0062     list << c;
0063 
0064 #define I18N_CONSTANT(NAME) \
0065     i->name = NAME; \
0066     i->category = cat; \
0067     ++i;
0068 
0069 #define I18N_CONSTANT_DAYS(NAME) \
0070     i->unit = days; \
0071     I18N_CONSTANT(NAME)
0072 
0073 void Constants::Private::populate()
0074 {
0075     Constant c;
0076 
0077     // CODATA Internationally recommended values of the Fundamental Physical Constants
0078     // Constants not yet included, to be included in future releases (TODO)
0079     // From: http://physics.nist.gov/cuu/Constants/
0080     // Date: 2016-03-28
0081 
0082     //   Quantity                                                       Value                 Uncertainty           Unit
0083     // -----------------------------------------------------------------------------------------------------------------------------
0084     // alpha particle-electron mass ratio                          7294.299 541 36          0.000 000 24
0085     // alpha particle mass                                         6.644 657 230 e-27       0.000 000 082 e-27       kg
0086     // alpha particle mass energy equivalent                       5.971 920 097 e-10       0.000 000 073 e-10       J
0087     // alpha particle mass energy equivalent in MeV                3727.379 378             0.000 023                MeV
0088     // alpha particle mass in u                                    4.001 506 179 127        0.000 000 000 063        u
0089     // alpha particle molar mass                                   4.001 506 179 127 e-3    0.000 000 000 063 e-3    kg mol^-1
0090     // alpha particle-proton mass ratio                            3.972 599 689 07         0.000 000 000 36
0091     // Angstrom star                                               1.000 014 95 e-10        0.000 000 90 e-10        m
0092     // atomic mass constant energy equivalent                      1.492 418 062 e-10       0.000 000 018 e-10       J
0093     // atomic mass constant energy equivalent in MeV               931.494 0954             0.000 0057               MeV
0094     // atomic mass unit-electron volt relationship                 931.494 0954 e6          0.000 0057 e6            eV
0095     // atomic mass unit-hartree relationship                       3.423 177 6902 e7        0.000 000 0016 e7        E_h
0096     // atomic mass unit-hertz relationship                         2.252 342 7206 e23       0.000 000 0010 e23       Hz
0097     // atomic mass unit-inverse meter relationship                 7.513 006 6166 e14       0.000 000 0034 e14       m^-1
0098     // atomic mass unit-joule relationship                         1.492 418 062 e-10       0.000 000 018 e-10       J
0099     // atomic mass unit-kelvin relationship                        1.080 954 38 e13         0.000 000 62 e13         K
0100     // atomic mass unit-kilogram relationship                      1.660 539 040 e-27       0.000 000 020 e-27       kg
0101     // atomic unit of 1st hyperpolarizability                      3.206 361 329 e-53       0.000 000 020 e-53       C^3 m^3 J^-2
0102     // atomic unit of 2nd hyperpolarizability                      6.235 380 085 e-65       0.000 000 077 e-65       C^4 m^4 J^-3
0103     // atomic unit of action                                       1.054 571 800 e-34       0.000 000 013 e-34       J s
0104     // atomic unit of charge                                       1.602 176 6208 e-19      0.000 000 0098 e-19      C
0105     // atomic unit of charge density                               1.081 202 3770 e12       0.000 000 0067 e12       C m^-3
0106     // atomic unit of current                                      6.623 618 183 e-3        0.000 000 041 e-3        A
0107     // atomic unit of electric dipole mom.                         8.478 353 552 e-30       0.000 000 052 e-30       C m
0108     // atomic unit of electric field                               5.142 206 707 e11        0.000 000 032 e11        V m^-1
0109     // atomic unit of electric field gradient                      9.717 362 356 e21        0.000 000 060 e21        V m^-2
0110     // atomic unit of electric polarizability                      1.648 777 2731 e-41      0.000 000 0011 e-41      C^2 m^2 J^-1
0111     // atomic unit of electric potential                           27.211 386 02            0.000 000 17             V
0112     // atomic unit of electric quadrupole mom.                     4.486 551 484 e-40       0.000 000 028 e-40       C m^2
0113     // atomic unit of energy                                       4.359 744 650 e-18       0.000 000 054 e-18       J
0114     // atomic unit of force                                        8.238 723 36 e-8         0.000 000 10 e-8         N
0115     // atomic unit of length                                       0.529 177 210 67 e-10    0.000 000 000 12 e-10    m
0116     // atomic unit of mag. dipole mom.                             1.854 801 999 e-23       0.000 000 011 e-23       J T^-1
0117     // atomic unit of mag. flux density                            2.350 517 550 e5         0.000 000 014 e5         T
0118     // atomic unit of magnetizability                              7.891 036 5886 e-29      0.000 000 0090 e-29      J T^-2
0119     // atomic unit of mass                                         9.109 383 56 e-31        0.000 000 11 e-31        kg
0120     // atomic unit of mom.um                                       1.992 851 882 e-24       0.000 000 024 e-24       kg m s^-1
0121     // atomic unit of permittivity                                 1.112 650 056... e-10    (exact)                  F m^-1
0122     // atomic unit of time                                         2.418 884 326 509 e-17   0.000 000 000 014 e-17   s
0123     // atomic unit of velocity                                     2.187 691 262 77 e6      0.000 000 000 50 e6      m s^-1
0124     // Bohr magneton in eV/T                                       5.788 381 8012 e-5       0.000 000 0026 e-5       eV T^-1
0125     // Bohr magneton in Hz/T                                       13.996 245 042 e9        0.000 000 086 e9         Hz T^-1
0126     // Bohr magneton in inverse meters per tesla                   46.686 448 14            0.000 000 29             m^-1 T^-1
0127     // Bohr magneton in K/T                                        0.671 714 05             0.000 000 39             K T^-1
0128     // Boltzmann constant in eV/K                                  8.617 3303 e-5           0.000 0050 e-5           eV K^-1
0129     // Boltzmann constant in Hz/K                                  2.083 6612 e10           0.000 0012 e10           Hz K^-1
0130     // Boltzmann constant in inverse meters per kelvin             69.503 457               0.000 040                m^-1 K^-1
0131     // classical electron radius                                   2.817 940 3227 e-15      0.000 000 0019 e-15      m
0132     // Cu x unit                                                   1.002 076 97 e-13        0.000 000 28 e-13        m
0133     // deuteron-electron mag. mom. ratio                           -4.664 345 535 e-4       0.000 000 026 e-4
0134     // deuteron-electron mass ratio                                3670.482 967 85          0.000 000 13
0135     // deuteron g factor                                           0.857 438 2311           0.000 000 0048
0136     // deuteron mag. mom.                                          0.433 073 5040 e-26      0.000 000 0036 e-26      J T^-1
0137     // deuteron mag. mom. to Bohr magneton ratio                   0.466 975 4554 e-3       0.000 000 0026 e-3
0138     // deuteron mag. mom. to nuclear magneton ratio                0.857 438 2311           0.000 000 0048
0139     // deuteron mass                                               3.343 583 719 e-27       0.000 000 041 e-27       kg
0140     // deuteron mass energy equivalent                             3.005 063 183 e-10       0.000 000 037 e-10       J
0141     // deuteron mass energy equivalent in MeV                      1875.612 928             0.000 012                MeV
0142     // deuteron mass in u                                          2.013 553 212 745        0.000 000 000 040        u
0143     // deuteron molar mass                                         2.013 553 212 745 e-3    0.000 000 000 040 e-3    kg mol^-1
0144     // deuteron-neutron mag. mom. ratio                            -0.448 206 52            0.000 000 11
0145     // deuteron-proton mag. mom. ratio                             0.307 012 2077           0.000 000 0015
0146     // deuteron-proton mass ratio                                  1.999 007 500 87         0.000 000 000 19
0147     // deuteron rms charge radius                                  2.1413 e-15              0.0025 e-15              m
0148     // electron charge to mass quotient                            -1.758 820 024 e11       0.000 000 011 e11        C kg^-1
0149     // electron-deuteron mag. mom. ratio                           -2143.923 499            0.000 012
0150     // electron-deuteron mass ratio                                2.724 437 107 484 e-4    0.000 000 000 096 e-4
0151     // electron g factor                                           -2.002 319 304 361 82    0.000 000 000 000 52
0152     // electron gyromag. ratio                                     1.760 859 644 e11        0.000 000 011 e11        s^-1 T^-1
0153     // electron gyromag. ratio over 2 pi                           28 024.951 64            0.000 17                 MHz T^-1
0154     // electron-helion mass ratio                                  1.819 543 074 854 e-4    0.000 000 000 088 e-4
0155     // electron mag. mom.                                          -928.476 4620 e-26       0.000 0057 e-26          J T^-1
0156     // electron mag. mom. anomaly                                  1.159 652 180 91 e-3     0.000 000 000 26 e-3
0157     // electron mag. mom. to Bohr magneton ratio                   -1.001 159 652 180 91    0.000 000 000 000 26
0158     // electron mag. mom. to nuclear magneton ratio                -1838.281 972 34         0.000 000 17
0159 
0160     // electron mass energy equivalent                             8.187 105 65 e-14        0.000 000 10 e-14        J
0161 
0162     // electron mass in u                                          5.485 799 090 70 e-4     0.000 000 000 16 e-4     u
0163     // electron molar mass                                         5.485 799 090 70 e-7     0.000 000 000 16 e-7     kg mol^-1
0164     // electron-muon mag. mom. ratio                               206.766 9880             0.000 0046
0165     // electron-muon mass ratio                                    4.836 331 70 e-3         0.000 000 11 e-3
0166     // electron-neutron mag. mom. ratio                            960.920 50               0.000 23
0167     // electron-neutron mass ratio                                 5.438 673 4428 e-4       0.000 000 0027 e-4
0168     // electron-proton mag. mom. ratio                             -658.210 6866            0.000 0020
0169     // electron-proton mass ratio                                  5.446 170 213 52 e-4     0.000 000 000 52 e-4
0170     // electron-tau mass ratio                                     2.875 92 e-4             0.000 26 e-4
0171     // electron to alpha particle mass ratio                       1.370 933 554 798 e-4    0.000 000 000 045 e-4
0172     // electron to shielded helion mag. mom. ratio                 864.058 257              0.000 010
0173     // electron to shielded proton mag. mom. ratio                 -658.227 5971            0.000 0072
0174     // electron-triton mass ratio                                  1.819 200 062 203 e-4    0.000 000 000 084 e-4
0175     // electron volt-atomic mass unit relationship                 1.073 544 1105 e-9       0.000 000 0066 e-9       u
0176     // electron volt-hartree relationship                          3.674 932 248 e-2        0.000 000 023 e-2        E_h
0177     // electron volt-hertz relationship                            2.417 989 262 e14        0.000 000 015 e14        Hz
0178     // electron volt-inverse meter relationship                    8.065 544 005 e5         0.000 000 050 e5         m^-1
0179     // electron volt-joule relationship                            1.602 176 6208 e-19      0.000 000 0098 e-19      J
0180     // electron volt-kelvin relationship                           1.160 452 21 e4          0.000 000 67 e4          K
0181     // electron volt-kilogram relationship                         1.782 661 907 e-36       0.000 000 011 e-36       kg
0182     // elementary charge over h                                    2.417 989 262 e14        0.000 000 015 e14        A J^-1
0183     // hartree-atomic mass unit relationship                       2.921 262 3197 e-8       0.000 000 0013 e-8       u
0184     // hartree-electron volt relationship                          27.211 386 02            0.000 000 17             eV
0185     // hartree-hertz relationship                                  6.579 683 920 711 e15    0.000 000 000 039 e15    Hz
0186     // hartree-inverse meter relationship                          2.194 746 313 702 e7     0.000 000 000 013 e7     m^-1
0187     // hartree-joule relationship                                  4.359 744 650 e-18       0.000 000 054 e-18       J
0188     // hartree-kelvin relationship                                 3.157 7513 e5            0.000 0018 e5            K
0189     // hartree-kilogram relationship                               4.850 870 129 e-35       0.000 000 060 e-35       kg
0190     // helion-electron mass ratio                                  5495.885 279 22          0.000 000 27
0191     // helion g factor                                             -4.255 250 616           0.000 000 050
0192     // helion mag. mom.                                            -1.074 617 522 e-26      0.000 000 014 e-26       J T^-1
0193     // helion mag. mom. to Bohr magneton ratio                     -1.158 740 958 e-3       0.000 000 014 e-3
0194     // helion mag. mom. to nuclear magneton ratio                  -2.127 625 308           0.000 000 025
0195     // helion mass                                                 5.006 412 700 e-27       0.000 000 062 e-27       kg
0196     // helion mass energy equivalent                               4.499 539 341 e-10       0.000 000 055 e-10       J
0197     // helion mass energy equivalent in MeV                        2808.391 586             0.000 017                MeV
0198     // helion mass in u                                            3.014 932 246 73         0.000 000 000 12         u
0199     // helion molar mass                                           3.014 932 246 73 e-3     0.000 000 000 12 e-3     kg mol^-1
0200     // helion-proton mass ratio                                    2.993 152 670 46         0.000 000 000 29
0201     // hertz-atomic mass unit relationship                         4.439 821 6616 e-24      0.000 000 0020 e-24      u
0202     // hertz-electron volt relationship                            4.135 667 662 e-15       0.000 000 025 e-15       eV
0203     // hertz-hartree relationship                                  1.519 829 846 0088 e-16  0.000 000 000 0090 e-16  E_h
0204     // hertz-inverse meter relationship                            3.335 640 951... e-9     (exact)                  m^-1
0205     // hertz-joule relationship                                    6.626 070 040 e-34       0.000 000 081 e-34       J
0206     // hertz-kelvin relationship                                   4.799 2447 e-11          0.000 0028 e-11          K
0207     // hertz-kilogram relationship                                 7.372 497 201 e-51       0.000 000 091 e-51       kg
0208     // inverse fine-structure constant                             137.035 999 139          0.000 000 031
0209     // inverse meter-atomic mass unit relationship                 1.331 025 049 00 e-15    0.000 000 000 61 e-15    u
0210     // inverse meter-electron volt relationship                    1.239 841 9739 e-6       0.000 000 0076 e-6       eV
0211     // inverse meter-hartree relationship                          4.556 335 252 767 e-8    0.000 000 000 027 e-8    E_h
0212     // inverse meter-hertz relationship                            299 792 458              (exact)                  Hz
0213     // inverse meter-joule relationship                            1.986 445 824 e-25       0.000 000 024 e-25       J
0214     // inverse meter-kelvin relationship                           1.438 777 36 e-2         0.000 000 83 e-2         K
0215     // inverse meter-kilogram relationship                         2.210 219 057 e-42       0.000 000 027 e-42       kg
0216     // joule-atomic mass unit relationship                         6.700 535 363 e9         0.000 000 082 e9         u
0217     // joule-electron volt relationship                            6.241 509 126 e18        0.000 000 038 e18        eV
0218     // joule-hartree relationship                                  2.293 712 317 e17        0.000 000 028 e17        E_h
0219     // joule-hertz relationship                                    1.509 190 205 e33        0.000 000 019 e33        Hz
0220     // joule-inverse meter relationship                            5.034 116 651 e24        0.000 000 062 e24        m^-1
0221     // joule-kelvin relationship                                   7.242 9731 e22           0.000 0042 e22           K
0222     // joule-kilogram relationship                                 1.112 650 056... e-17    (exact)                  kg
0223     // kelvin-atomic mass unit relationship                        9.251 0842 e-14          0.000 0053 e-14          u
0224     // kelvin-electron volt relationship                           8.617 3303 e-5           0.000 0050 e-5           eV
0225     // kelvin-hartree relationship                                 3.166 8105 e-6           0.000 0018 e-6           E_h
0226     // kelvin-hertz relationship                                   2.083 6612 e10           0.000 0012 e10           Hz
0227     // kelvin-inverse meter relationship                           69.503 457               0.000 040                m^-1
0228     // kelvin-joule relationship                                   1.380 648 52 e-23        0.000 000 79 e-23        J
0229     // kelvin-kilogram relationship                                1.536 178 65 e-40        0.000 000 88 e-40        kg
0230     // kilogram-atomic mass unit relationship                      6.022 140 857 e26        0.000 000 074 e26        u
0231     // kilogram-electron volt relationship                         5.609 588 650 e35        0.000 000 034 e35        eV
0232     // kilogram-hartree relationship                               2.061 485 823 e34        0.000 000 025 e34        E_h
0233     // kilogram-hertz relationship                                 1.356 392 512 e50        0.000 000 017 e50        Hz
0234     // kilogram-inverse meter relationship                         4.524 438 411 e41        0.000 000 056 e41        m^-1
0235     // kilogram-joule relationship                                 8.987 551 787... e16     (exact)                  J
0236     // kilogram-kelvin relationship                                6.509 6595 e39           0.000 0037 e39           K
0237     // lattice parameter of silicon                                543.102 0504 e-12        0.000 0089 e-12          m
0238     // molar mass constant                                         1 e-3                    (exact)                  kg mol^-1
0239     // molar mass of carbon-12                                     12 e-3                   (exact)                  kg mol^-1
0240     // molar Planck constant times c                               0.119 626 565 582        0.000 000 000 054        J m mol^-1
0241     // molar volume of ideal gas (273.15 K, 100 kPa)               22.710 947 e-3           0.000 013 e-3            m^3 mol^-1
0242     // molar volume of ideal gas (273.15 K, 101.325 kPa)           22.413 962 e-3           0.000 013 e-3            m^3 mol^-1
0243     // molar volume of silicon                                     12.058 832 14 e-6        0.000 000 61 e-6         m^3 mol^-1
0244     // Mo x unit                                                   1.002 099 52 e-13        0.000 000 53 e-13        m
0245     // muon Compton wavelength                                     11.734 441 11 e-15       0.000 000 26 e-15        m
0246     // muon Compton wavelength over 2 pi                           1.867 594 308 e-15       0.000 000 042 e-15       m
0247     // muon-electron mass ratio                                    206.768 2826             0.000 0046
0248     // muon g factor                                               -2.002 331 8418          0.000 000 0013
0249     // muon mag. mom.                                              -4.490 448 26 e-26       0.000 000 10 e-26        J T^-1
0250     // muon mag. mom. anomaly                                      1.165 920 89 e-3         0.000 000 63 e-3
0251     // muon mag. mom. to Bohr magneton ratio                       -4.841 970 48 e-3        0.000 000 11 e-3
0252     // muon mag. mom. to nuclear magneton ratio                    -8.890 597 05            0.000 000 20
0253     // muon mass energy equivalent                                 1.692 833 774 e-11       0.000 000 043 e-11       J
0254     // muon mass in u                                              0.113 428 9257           0.000 000 0025           u
0255     // muon molar mass                                             0.113 428 9257 e-3       0.000 000 0025 e-3       kg mol^-1
0256     // muon-neutron mass ratio                                     0.112 454 5167           0.000 000 0025
0257     // muon-proton mag. mom. ratio                                 -3.183 345 142           0.000 000 071
0258     // muon-proton mass ratio                                      0.112 609 5262           0.000 000 0025
0259     // muon-tau mass ratio                                         5.946 49 e-2             0.000 54 e-2
0260     // natural unit of action                                      1.054 571 800 e-34       0.000 000 013 e-34       J s
0261     // natural unit of action in eV s                              6.582 119 514 e-16       0.000 000 040 e-16       eV s
0262     // natural unit of energy                                      8.187 105 65 e-14        0.000 000 10 e-14        J
0263     // natural unit of energy in MeV                               0.510 998 9461           0.000 000 0031           MeV
0264     // natural unit of length                                      386.159 267 64 e-15      0.000 000 18 e-15        m
0265     // natural unit of mass                                        9.109 383 56 e-31        0.000 000 11 e-31        kg
0266     // natural unit of mom.um                                      2.730 924 488 e-22       0.000 000 034 e-22       kg m s^-1
0267     // natural unit of mom.um in MeV/c                             0.510 998 9461           0.000 000 0031           MeV/c
0268     // natural unit of time                                        1.288 088 667 12 e-21    0.000 000 000 58 e-21    s
0269     // natural unit of velocity                                    299 792 458              (exact)                  m s^-1
0270     // neutron Compton wavelength                                  1.319 590 904 81 e-15    0.000 000 000 88 e-15    m
0271     // neutron Compton wavelength over 2 pi                        0.210 019 415 36 e-15    0.000 000 000 14 e-15    m
0272     // neutron-electron mag. mom. ratio                            1.040 668 82 e-3         0.000 000 25 e-3
0273     // neutron-electron mass ratio                                 1838.683 661 58          0.000 000 90
0274     // neutron g factor                                            -3.826 085 45            0.000 000 90
0275     // neutron gyromag. ratio                                      1.832 471 72 e8          0.000 000 43 e8          s^-1 T^-1
0276     // neutron gyromag. ratio over 2 pi                            29.164 6933              0.000 0069               MHz T^-1
0277     // neutron mag. mom.                                           -0.966 236 50 e-26       0.000 000 23 e-26        J T^-1
0278     // neutron mag. mom. to Bohr magneton ratio                    -1.041 875 63 e-3        0.000 000 25 e-3
0279     // neutron mag. mom. to nuclear magneton ratio                 -1.913 042 73            0.000 000 45
0280     // neutron mass energy equivalent                              1.505 349 739 e-10       0.000 000 019 e-10       J
0281     // neutron mass energy equivalent in MeV                       939.565 4133             0.000 0058               MeV
0282     // neutron mass in u                                           1.008 664 915 88         0.000 000 000 49         u
0283     // neutron molar mass                                          1.008 664 915 88 e-3     0.000 000 000 49 e-3     kg mol^-1
0284     // neutron-muon mass ratio                                     8.892 484 08             0.000 000 20
0285     // neutron-proton mag. mom. ratio                              -0.684 979 34            0.000 000 16
0286     // neutron-proton mass difference                              2.305 573 77 e-30        0.000 000 85 e-30
0287     // neutron-proton mass difference energy equivalent            2.072 146 37 e-13        0.000 000 76 e-13
0288     // neutron-proton mass difference energy equivalent in MeV     1.293 332 05             0.000 000 48
0289     // neutron-proton mass difference in u                         0.001 388 449 00         0.000 000 000 51
0290     // neutron-proton mass ratio                                   1.001 378 418 98         0.000 000 000 51
0291     // neutron-tau mass ratio                                      0.528 790                0.000 048
0292     // neutron to shielded proton mag. mom. ratio                  -0.684 996 94            0.000 000 16
0293     // Newtonian constant of gravitation over h-bar c              6.708 61 e-39            0.000 31 e-39            (GeV/c^2)^-2
0294     // nuclear magneton in eV/T                                    3.152 451 2550 e-8       0.000 000 0015 e-8       eV T^-1
0295     // nuclear magneton in inverse meters per tesla                2.542 623 432 e-2        0.000 000 016 e-2        m^-1 T^-1
0296     // nuclear magneton in K/T                                     3.658 2690 e-4           0.000 0021 e-4           K T^-1
0297     // nuclear magneton in MHz/T                                   7.622 593 285            0.000 000 047            MHz T^-1
0298     // Planck constant in eV s                                     4.135 667 662 e-15       0.000 000 025 e-15       eV s
0299     // Planck constant over 2 pi in eV s                           6.582 119 514 e-16       0.000 000 040 e-16       eV s
0300     // Planck constant over 2 pi times c in MeV fm                 197.326 9788             0.000 0012               MeV fm
0301     // Planck length                                               1.616 229 e-35           0.000 038 e-35           m
0302     // Planck mass                                                 2.176 470 e-8            0.000 051 e-8            kg
0303     // Planck mass energy equivalent in GeV                        1.220 910 e19            0.000 029 e19            GeV
0304     // Planck temperature                                          1.416 808 e32            0.000 033 e32            K
0305     // Planck time                                                 5.391 16 e-44            0.000 13 e-44            s
0306     // proton charge to mass quotient                              9.578 833 226 e7         0.000 000 059 e7         C kg^-1
0307     // proton Compton wavelength                                   1.321 409 853 96 e-15    0.000 000 000 61 e-15    m
0308     // proton Compton wavelength over 2 pi                         0.210 308 910 109 e-15   0.000 000 000 097 e-15   m
0309     // proton-electron mass ratio                                  1836.152 673 89          0.000 000 17
0310     // proton g factor                                             5.585 694 702            0.000 000 017
0311     // proton gyromag. ratio                                       2.675 221 900 e8         0.000 000 018 e8         s^-1 T^-1
0312     // proton gyromag. ratio over 2 pi                             42.577 478 92            0.000 000 29             MHz T^-1
0313     // proton mag. mom.                                            1.410 606 7873 e-26      0.000 000 0097 e-26      J T^-1
0314     // proton mag. mom. to Bohr magneton ratio                     1.521 032 2053 e-3       0.000 000 0046 e-3
0315     // proton mag. mom. to nuclear magneton ratio                  2.792 847 3508           0.000 000 0085
0316     // proton mag. shielding correction                            25.691 e-6               0.011 e-6
0317     // proton mass energy equivalent                               1.503 277 593 e-10       0.000 000 018 e-10       J
0318     // proton mass energy equivalent in MeV                        938.272 0813             0.000 0058               MeV
0319     // proton mass in u                                            1.007 276 466 879        0.000 000 000 091        u
0320     // proton molar mass                                           1.007 276 466 879 e-3    0.000 000 000 091 e-3    kg mol^-1
0321     // proton-muon mass ratio                                      8.880 243 38             0.000 000 20
0322     // proton-neutron mag. mom. ratio                              -1.459 898 05            0.000 000 34
0323     // proton-neutron mass ratio                                   0.998 623 478 44         0.000 000 000 51
0324     // proton rms charge radius                                    0.8751 e-15              0.0061 e-15              m
0325     // proton-tau mass ratio                                       0.528 063                0.000 048
0326     // Rydberg constant times c in Hz                              3.289 841 960 355 e15    0.000 000 000 019 e15    Hz
0327     // Rydberg constant times hc in eV                             13.605 693 009           0.000 000 084            eV
0328     // Rydberg constant times hc in J                              2.179 872 325 e-18       0.000 000 027 e-18       J
0329     // Sackur-Tetrode constant (1 K, 100 kPa)                      -1.151 7084              0.000 0014
0330     // Sackur-Tetrode constant (1 K, 101.325 kPa)                  -1.164 8714              0.000 0014
0331     // shielded helion gyromag. ratio                              2.037 894 585 e8         0.000 000 027 e8         s^-1 T^-1
0332     // shielded helion gyromag. ratio over 2 pi                    32.434 099 66            0.000 000 43             MHz T^-1
0333     // shielded helion mag. mom.                                   -1.074 553 080 e-26      0.000 000 014 e-26       J T^-1
0334     // shielded helion mag. mom. to Bohr magneton ratio            -1.158 671 471 e-3       0.000 000 014 e-3
0335     // shielded helion mag. mom. to nuclear magneton ratio         -2.127 497 720           0.000 000 025
0336     // shielded helion to proton mag. mom. ratio                   -0.761 766 5603          0.000 000 0092
0337     // shielded helion to shielded proton mag. mom. ratio          -0.761 786 1313          0.000 000 0033
0338     // shielded proton gyromag. ratio                              2.675 153 171 e8         0.000 000 033 e8         s^-1 T^-1
0339     // shielded proton gyromag. ratio over 2 pi                    42.576 385 07            0.000 000 53             MHz T^-1
0340     // shielded proton mag. mom.                                   1.410 570 547 e-26       0.000 000 018 e-26       J T^-1
0341     // shielded proton mag. mom. to Bohr magneton ratio            1.520 993 128 e-3        0.000 000 017 e-3
0342     // shielded proton mag. mom. to nuclear magneton ratio         2.792 775 600            0.000 000 030
0343     // standard atmosphere                                         101 325                  (exact)                  Pa
0344     // standard-state pressure                                     100 000                  (exact)                  Pa
0345     // tau Compton wavelength                                      0.697 787 e-15           0.000 063 e-15           m
0346     // tau Compton wavelength over 2 pi                            0.111 056 e-15           0.000 010 e-15           m
0347     // tau-electron mass ratio                                     3477.15                  0.31
0348     // tau mass energy equivalent                                  2.846 78 e-10            0.000 26 e-10            J
0349     // tau mass in u                                               1.907 49                 0.000 17                 u
0350     // tau molar mass                                              1.907 49 e-3             0.000 17 e-3             kg mol^-1
0351     // tau-muon mass ratio                                         16.8167                  0.0015
0352     // tau-neutron mass ratio                                      1.891 11                 0.000 17
0353     // tau-proton mass ratio                                       1.893 72                 0.000 17
0354     // triton-electron mass ratio                                  5496.921 535 88          0.000 000 26
0355     // triton g factor                                             5.957 924 920            0.000 000 028
0356     // triton mag. mom.                                            1.504 609 503 e-26       0.000 000 012 e-26       J T^-1
0357     // triton mag. mom. to Bohr magneton ratio                     1.622 393 6616 e-3       0.000 000 0076 e-3
0358     // triton mag. mom. to nuclear magneton ratio                  2.978 962 460            0.000 000 014
0359     // triton mass                                                 5.007 356 665 e-27       0.000 000 062 e-27       kg
0360     // triton mass energy equivalent                               4.500 387 735 e-10       0.000 000 055 e-10       J
0361     // triton mass energy equivalent in MeV                        2808.921 112             0.000 017                MeV
0362     // triton mass in u                                            3.015 500 716 32         0.000 000 000 11         u
0363     // triton molar mass                                           3.015 500 716 32 e-3     0.000 000 000 11 e-3     kg mol^-1
0364     // triton-proton mass ratio                                    2.993 717 033 48         0.000 000 000 22
0365     // unified atomic mass unit                                    1.660 539 040 e-27       0.000 000 020 e-27       kg
0366     // Wien frequency displacement law constant                    5.878 9238 e10           0.000 0034 e10           Hz K^-1
0367     // Wien wavelength displacement law constant                   2.897 7729 e-3           0.000 0017 e-3           m K
0368 
0369     // Universal.
0370     PUSH_CONSTANT_NO_UNIT("π (Archimedes' constant pi)", "3.1415926535897932");
0371     PUSH_CONSTANT_NO_UNIT("e (Euler's number)", "2.7182818284590452");
0372     PUSH_CONSTANT_NO_UNIT("φ (golden ratio)", "1.6180339887498948");
0373 
0374     // General Physics.
0375     PUSH_CONSTANT_CODATA("Characteristic Impedance of Vacuum", "376.730313461", "Ω",          "exact",           "2016-03-28");
0376     PUSH_CONSTANT_CODATA("Dirac's Constant",          "1.054571800e-34",        "J·s",        "0.000000013e-34", "2016-03-28");  // CODATA name: Planck constant over 2 pi
0377     PUSH_CONSTANT_CODATA("Electric Constant",         "8.854187817e-12",        "F/m",        "exact",           "2016-03-28");
0378     PUSH_CONSTANT_CODATA("Gravitation Constant",      "6.67408e-11",            "m³/(kg·s²)", "0.00031e-11",     "2016-03-28");
0379     PUSH_CONSTANT_CODATA("Magnetic Constant",         "12.566370614e-7",        "N/A²",       "exact",           "2016-03-28");  // TODO: Put more figures !
0380     PUSH_CONSTANT_CODATA("Planck's Constant",         "6.626070040e-34",        "J·s",        "0.000000081e-34", "2016-03-28");
0381     PUSH_CONSTANT_CODATA("Speed of Light in Vacuum",  "299792458",              "m/s",        "exact",           "2016-03-28");
0382     PUSH_CONSTANT_CODATA("Standard Gravity",          "9.80665",                "m/s²",       "exact",           "2016-03-28");
0383 
0384     // Electromagnetic.
0385     PUSH_CONSTANT_CODATA("Bohr-Procopiu Magneton",                      "927.4009994e-26",     "J/T",    "0.0000057e-26",   "2016-03-28");
0386     PUSH_CONSTANT_CODATA("Conductance Quantum",                         "7.7480917310e-5",     "S",      "0.0000000018e-5", "2016-03-28");
0387     PUSH_CONSTANT("Coulomb's Constant",                                 "8.987742438e9",       "N·m²/C²");
0388     PUSH_CONSTANT_CODATA("Elementary Charge",                           "1.602 176 6208 e-19", "C",      "0.0000000098e-19", "2016-03-28");
0389     PUSH_CONSTANT_CODATA("Conventional value of Josephson Constant",    "483597.9e9",          "Hz/V",   "exact",            "2016-03-28");
0390     PUSH_CONSTANT_CODATA("Josephson Constant",                          "483597.8525e9",       "Hz/V",   "0.0030e9",         "2016-03-28");
0391     PUSH_CONSTANT_CODATA("Magnetic Flux Quantum",                       "2.06783383e-15",      "Wb",     "0.000000013e-15",  "2016-03-28");
0392     PUSH_CONSTANT_CODATA("Nuclear Magneton",                            "5.050783699e-27",     "J/T",    "0.000000031e-27",  "2016-03-28");
0393     PUSH_CONSTANT_CODATA("Resistance Quantum",                          "12906.4037278",       "Ω",      "0.0000029",        "2016-03-28");  // CODATA name: inverse of conductance quantum
0394     PUSH_CONSTANT_CODATA("Conventional value of von Klitzing Constant", "25812.807",           "Ω",      "exact",            "2016-03-28");
0395     PUSH_CONSTANT_CODATA("von Klitzing Constant",                       "25812.8074555",       "Ω",      "0.0000059",        "2016-03-28");
0396 
0397     // Atomic & Nuclear.
0398     PUSH_CONSTANT_CODATA("Bohr Radius",                    "0.52917721067e-10", "m",     "0.00000000012e-10", "2016-03-28");
0399     PUSH_CONSTANT_CODATA("Fermi Coupling Constant",        "1.1663787e-5",      "Ge/V²", "0.0000006e-5",      "2016-03-28");
0400     PUSH_CONSTANT_CODATA("Fine-structure Constant",        "7.2973525664e-3",   "",      "0.0000000017e-3",   "2016-03-28");
0401     PUSH_CONSTANT_CODATA("Hartree Energy",                 "4.359744650e-18",   "J",     "0.000000054e-18",   "2016-03-28");
0402     PUSH_CONSTANT_CODATA("Hartree Energy in eV",           "27.21138602",       "eV",    "0.00000017",        "2016-03-28");
0403     PUSH_CONSTANT_CODATA("Quantum of Circulation",         "3.6369475486e-4",   "m²/s",  "0.0000000017e-4",   "2016-03-28");
0404     PUSH_CONSTANT_CODATA("Quantum of Circulation times 2", "7.2738950972e-4",   "m²/s",  "0.0000000033e-4",   "2016-03-28");  // I don't know why it is usefull, but it is present in CODATA constants, so I added it  -- Hadrien Theveneau, 2016-03-28
0405     PUSH_CONSTANT_CODATA("Rydberg Constant",               "10973731.568508",   "1/m",   "0.000065",          "2016-03-28");
0406     PUSH_CONSTANT_CODATA("Thomson Cross Section",          "0.66524587158e-28", "m²",    "0.00000000091e-28", "2016-03-28");
0407     PUSH_CONSTANT_CODATA("Weak Mixing Angle",              "0.2223",            "",      "0.0021",            "2016-03-28");
0408 
0409     // Physico-chemical.
0410     PUSH_CONSTANT_CODATA("Atomic Mass Unit",                               "1.660539040e-27",  "kg",         "0.000000020e-27",  "2016-03-28");  // CODATA name: atomic mass constant
0411     PUSH_CONSTANT_CODATA("Avogadro's Number",                              "6.022140857e23",   "1/mol",      "0.000000074e23",   "2016-03-28");  // CODATA name: Avogadro constant
0412     PUSH_CONSTANT_CODATA("Boltzmann Constant",                             "1.38064852e-23",   "J/K",        "0.00000079e-23",   "2016-03-28");
0413     PUSH_CONSTANT_CODATA("Compton wavelength",                             "2.4263102367e-12", "m",          "0.0000000011e-12", "2016-03-28");
0414     PUSH_CONSTANT_CODATA("Compton wavelength over 2 pi",                   "386.15926764e-15", "m",          "0.00000018e-15",   "2016-03-28");
0415     PUSH_CONSTANT_CODATA("Electron-volt",                                  "1.6021766208e-19", "J",          "0.0000000098e-19", "2016-03-28");
0416     PUSH_CONSTANT_CODATA("Faraday Constant",                               "96485.33289",      "C/mol",      "0.00059",          "2016-03-28");
0417     // PUSH_CONSTANT_CODATA("Faraday constant for conventional electric current", "96 485.3251", "C_90_mol^-1", "0.0012", "2016-03-28");       // TODO: Handle C_90_mol
0418     PUSH_CONSTANT_CODATA("First Radiation Constant",                       "3.741771790e-16",  "W·m²",       "0.000000046e-16",  "2016-03-28");
0419     PUSH_CONSTANT_CODATA("First Radiation Constant for Spectral Radiance", "1.191042953e-16",  "(W·m²)/sr",  "0.000000015e-16",  "2016-03-28");
0420     PUSH_CONSTANT_CODATA("Gas Constant",                                   "8.3144598",        "J/(K·mol)",  "0.0000048",        "2016-03-28");
0421     PUSH_CONSTANT_CODATA("Loschmidt constant (273.15 K, 100 kPa)",         "2.6516467e25",     "1/m³",       "0.0000015e25",     "2016-03-28");
0422     PUSH_CONSTANT_CODATA("Loschmidt constant (273.15 K, 101.325 kPa)",     "2.6867811e25",     "1/m³",       "0.0000015e25",     "2016-03-28");
0423     PUSH_CONSTANT_CODATA("Molar Planck Constant",                          "3.9903127110e-10", "J·s/mol",    "0.0000000018e-10", "2016-03-28");
0424     PUSH_CONSTANT_CODATA("Second Radiation Constant",                      "1.43877736e-2",    "m·K",        "0.00000083e-2",    "2016-03-28");
0425     PUSH_CONSTANT_CODATA("Stefan-Boltzmann Constant",                      "5.670367e-8",      "W/(m²·K⁴)",  "0.000013e-8",      "2016-03-28");
0426     PUSH_CONSTANT_CODATA("{220} Lattice Spacing of Silicon",               "192.0155714e-12",  "m",          "0.0000032e-12",    "2016-03-28");
0427 
0428     // Astronomy.
0429     PUSH_CONSTANT("Astronomical Unit",      "149597870691",       "m");
0430     PUSH_CONSTANT("Light Year",             "9.4607304725808e15", "m");
0431     PUSH_CONSTANT("Parsec",                 "3.08567802e16",      "m");
0432     PUSH_CONSTANT_NO_UNIT("Gregorian Year", "365.2425");
0433     PUSH_CONSTANT_NO_UNIT("Julian Year",    "365.25");
0434     PUSH_CONSTANT_NO_UNIT("Sidereal Year",  "365.2564");
0435     PUSH_CONSTANT_NO_UNIT("Tropical Year",  "365.2422");
0436     PUSH_CONSTANT("Earth Mass",             "5.9736e24", "kg");
0437     PUSH_CONSTANT("Mean Earth Radius",      "6371000",   "m");
0438     PUSH_CONSTANT("Sun Mass",               "1.9891e30", "kg");
0439     PUSH_CONSTANT("Sun Radius",             "6.96265e8", "m");
0440     PUSH_CONSTANT("Sun Luminosity",         "3.827e26",  "W");
0441 
0442     // Molar Masses
0443     PUSH_CONSTANT("Aluminium",    "26.9815386",  "g/mol");
0444     PUSH_CONSTANT("Antimony",     "121.760",     "g/mol");
0445     PUSH_CONSTANT("Argon",        "39.948",      "g/mol");
0446     PUSH_CONSTANT("Arsenic",      "74.92160",    "g/mol");
0447     PUSH_CONSTANT("Barium",       "137.327",     "g/mol");
0448     PUSH_CONSTANT("Beryllium",    "9.012182",    "g/mol");
0449     PUSH_CONSTANT("Bismuth",      "208.98040",   "g/mol");
0450     PUSH_CONSTANT("Boron",        "10.811",      "g/mol");
0451     PUSH_CONSTANT("Bromine",      "79.904",      "g/mol");
0452     PUSH_CONSTANT("Cadmium",      "112.411",     "g/mol");
0453     PUSH_CONSTANT("Caesium",      "132.9054519", "g/mol");
0454     PUSH_CONSTANT("Calcium",      "40.078",      "g/mol");
0455     PUSH_CONSTANT("Carbon",       "12.0107",     "g/mol");
0456     PUSH_CONSTANT("Cerium",       "140.116",     "g/mol");
0457     PUSH_CONSTANT("Chlorine",     "35.453",      "g/mol");
0458     PUSH_CONSTANT("Chromium",     "51.9961",     "g/mol");
0459     PUSH_CONSTANT("Cobalt",       "58.933195",   "g/mol");
0460     PUSH_CONSTANT("Copper",       "63.546",      "g/mol");
0461     PUSH_CONSTANT("Dysprosium",   "162.500",     "g/mol");
0462     PUSH_CONSTANT("Erbium",       "167.259",     "g/mol");
0463     PUSH_CONSTANT("Europium",     "151.964",     "g/mol");
0464     PUSH_CONSTANT("Fluorine",     "18.9984032",  "g/mol");
0465     PUSH_CONSTANT("Gadolinium",   "157.25",      "g/mol");
0466     PUSH_CONSTANT("Gallium",      "69.723",      "g/mol");
0467     PUSH_CONSTANT("Germanium",    "72.64",       "g/mol");
0468     PUSH_CONSTANT("Gold",         "196.966569",  "g/mol");
0469     PUSH_CONSTANT("Hafnium",      "178.49",      "g/mol");
0470     PUSH_CONSTANT("Helium",       "4.002602",    "g/mol");
0471     PUSH_CONSTANT("Holmium",      "164.93032",   "g/mol");
0472     PUSH_CONSTANT("Hydrogen",     "1.00794",     "g/mol");
0473     PUSH_CONSTANT("Indium",       "114.818",     "g/mol");
0474     PUSH_CONSTANT("Iodine",       "126.90447",   "g/mol");
0475     PUSH_CONSTANT("Iridium",      "192.217",     "g/mol");
0476     PUSH_CONSTANT("Iron",         "55.845",      "g/mol");
0477     PUSH_CONSTANT("Krypton",      "83.798",      "g/mol");
0478     PUSH_CONSTANT("Lanthanum",    "138.90547",   "g/mol");
0479     PUSH_CONSTANT("Lead",         "207.2",       "g/mol");
0480     PUSH_CONSTANT("Lithium",      "6.941",       "g/mol");
0481     PUSH_CONSTANT("Lutetium",     "174.9668",    "g/mol");
0482     PUSH_CONSTANT("Magnesium",    "24.3050",     "g/mol");
0483     PUSH_CONSTANT("Manganese",    "54.938045",   "g/mol");
0484     PUSH_CONSTANT("Mercury",      "200.59",      "g/mol");
0485     PUSH_CONSTANT("Molybdenum",   "95.96",       "g/mol");
0486     PUSH_CONSTANT("Neodymium",    "144.242",     "g/mol");
0487     PUSH_CONSTANT("Neon",         "20.1797",     "g/mol");
0488     PUSH_CONSTANT("Nickel",       "58.6934",     "g/mol");
0489     PUSH_CONSTANT("Niobium",      "92.90638",    "g/mol");
0490     PUSH_CONSTANT("Nitrogen",     "14.0067",     "g/mol");
0491     PUSH_CONSTANT("Osmium",       "190.23",      "g/mol");
0492     PUSH_CONSTANT("Oxygen",       "15.9994",     "g/mol");
0493     PUSH_CONSTANT("Palladium",    "106.42",      "g/mol");
0494     PUSH_CONSTANT("Phosphorus",   "30.973762",   "g/mol");
0495     PUSH_CONSTANT("Platinum",     "192.084",     "g/mol");
0496     PUSH_CONSTANT("Potassium",    "39.0983",     "g/mol");
0497     PUSH_CONSTANT("Praseodymium", "140.90765",   "g/mol");
0498     PUSH_CONSTANT("Protactinium", "231.03588",   "g/mol");
0499     PUSH_CONSTANT("Rhenium",      "186.207",     "g/mol");
0500     PUSH_CONSTANT("Rubidium",     "85.4678",     "g/mol");
0501     PUSH_CONSTANT("Ruthenium",    "101.07",      "g/mol");
0502     PUSH_CONSTANT("Samarium",     "150.36",      "g/mol");
0503     PUSH_CONSTANT("Scandium",     "44.955912",   "g/mol");
0504     PUSH_CONSTANT("Selenium",     "78.96",       "g/mol");
0505     PUSH_CONSTANT("Silicon",      "28.0855",     "g/mol");
0506     PUSH_CONSTANT("Silver",       "107.8682",    "g/mol");
0507     PUSH_CONSTANT("Sodium",       "22.98976928", "g/mol");
0508     PUSH_CONSTANT("Strontium",    "87.62",       "g/mol");
0509     PUSH_CONSTANT("Sulfur",       "32.065",      "g/mol");
0510     PUSH_CONSTANT("Tantalum",     "180.94788",   "g/mol");
0511     PUSH_CONSTANT("Tellurium",    "127.60",      "g/mol");
0512     PUSH_CONSTANT("Terbium",      "158.92535",   "g/mol");
0513     PUSH_CONSTANT("Thallium",     "204.3833",    "g/mol");
0514     PUSH_CONSTANT("Thorium",      "232.03806",   "g/mol");
0515     PUSH_CONSTANT("Thulium",      "168.93421",   "g/mol");
0516     PUSH_CONSTANT("Tin",          "118.710",     "g/mol");
0517     PUSH_CONSTANT("Titanium",     "47.867",      "g/mol");
0518     PUSH_CONSTANT("Tungsten",     "183.84",      "g/mol");
0519     PUSH_CONSTANT("Uranium",      "238.02891",   "g/mol");
0520     PUSH_CONSTANT("Vanadium",     "51.9961",     "g/mol");
0521     PUSH_CONSTANT("Xenon",        "131.293",     "g/mol");
0522     PUSH_CONSTANT("Ytterbium",    "173.054",     "g/mol");
0523     PUSH_CONSTANT("Yttrium",      "88.90585",    "g/mol");
0524     PUSH_CONSTANT("Zinc",         "65.38",       "g/mol");
0525     PUSH_CONSTANT("Zirconium",    "91.224",      "g/mol");
0526 
0527     // Particle Masses
0528     // Leptons
0529     PUSH_CONSTANT_CODATA("Electron Mass", "0.5109989461", "MeV/c²", "0.0000000031", "2016-03-28");
0530     PUSH_CONSTANT_CODATA("Muon Mass",     "105.6583745",  "MeV/c²", "0.0000024",    "2016-03-28");
0531     PUSH_CONSTANT_CODATA("Tau Mass",      "1776.82",      "MeV/c²", "0.16",         "2016-03-28");
0532 
0533     // Quarks
0534     PUSH_CONSTANT("Up-Quark Mass",      "2.3",    "MeV/c²");
0535     PUSH_CONSTANT("Down-Quark Mass",    "4.8",    "MeV/c²");
0536     PUSH_CONSTANT("Charm-Quark Mass",   "1.275",  "GeV/c²");
0537     PUSH_CONSTANT("Strange-Quark Mass", "95",     "MeV/c²");
0538     PUSH_CONSTANT("Top-Quark Mass",     "173.21", "GeV/c²");
0539     PUSH_CONSTANT("Bottom-Quark Mass",  "4.18",   "GeV/c²");
0540 
0541     // Bosons
0542     PUSH_CONSTANT("W-Boson Mass",     "80.385" , "GeV/c²");
0543     PUSH_CONSTANT("Z-Boson Mass",     "91.1876", "GeV/c²");
0544     PUSH_CONSTANT("Higgs-Boson Mass", "125.7",   "GeV/c²");
0545 
0546     // Hadrons
0547     PUSH_CONSTANT_CODATA("Proton Mass",  "938.2720813", "MeV/c²", "0.0000058", "2016-03-28");
0548     PUSH_CONSTANT_CODATA("Neutron Mass", "939.5654133", "MeV/c²", "0.0000058", "2016-03-28");
0549 
0550     // SI-Units
0551     PUSH_CONSTANT_CODATA("Electron Mass (SI)", "9.10938356e-31",  "kg", "0.00000011e-31",  "2016-03-28");
0552     PUSH_CONSTANT_CODATA("Proton Mass (SI)",   "1.672621898e-27", "kg", "0.000000021e-27", "2016-03-28");
0553     PUSH_CONSTANT_CODATA("Neutron Mass (SI)",  "1.674927471e-27", "kg", "0.000000021e-27", "2016-03-28");
0554 }
0555 
0556 void Constants::Private::retranslateText()
0557 {
0558     auto i = list.begin();
0559     QString cat;
0560 
0561     // http://en.wikipedia.org/wiki/Mathematical_constant
0562     cat = i18nc("https://en.wikipedia.org/wiki/Mathematical_constant", "Universal");
0563 
0564     I18N_CONSTANT(i18n("Archimedes' constant Pi") + QString::fromUtf8(" (π)"));
0565     I18N_CONSTANT(i18n("Euler's number") + QString::fromUtf8(" (ℯ)"));
0566     I18N_CONSTANT(i18n("Golden ratio") + QString::fromUtf8(" (φ)"));
0567 
0568     // http://en.wikipedia.org/wiki/Physical_constant#Table_of_universal_constants
0569     cat = i18n("General Physics");
0570 
0571     I18N_CONSTANT(i18n("Characteristic Impedance of Vacuum"));
0572     I18N_CONSTANT(i18n("Dirac's Constant"));
0573     I18N_CONSTANT(i18n("Electric Constant"));
0574     I18N_CONSTANT(i18n("Gravitation Constant"));
0575     I18N_CONSTANT(i18n("Magnetic Constant"));
0576     I18N_CONSTANT(i18n("Planck's Constant"));
0577     I18N_CONSTANT(i18n("Speed of Light in Vacuum"));
0578     I18N_CONSTANT(i18n("Standard Gravity"));
0579 
0580 
0581     // http://en.wikipedia.org/wiki/Physical_constant#Table_of_electromagnetic_constants
0582     cat = i18n("Electromagnetic");
0583 
0584     I18N_CONSTANT(i18n("Bohr-Procopiu Magneton"));
0585     I18N_CONSTANT(i18n("Conductance Quantum"));
0586     I18N_CONSTANT(i18n("Coulomb's Constant"));
0587     I18N_CONSTANT(i18n("Elementary Charge"));
0588     I18N_CONSTANT(i18n("Conventional value of Josephson Constant"));
0589     I18N_CONSTANT(i18n("Josephson Constant"));
0590     I18N_CONSTANT(i18n("Magnetic Flux Quantum"));
0591     I18N_CONSTANT(i18n("Nuclear Magneton"));
0592     I18N_CONSTANT(i18n("Resistance Quantum"));
0593     I18N_CONSTANT(i18n("Conventional value of von Klitzing Constant"));
0594     I18N_CONSTANT(i18n("von Klitzing Constant"));
0595 
0596     // CODATA
0597     cat = i18n("Atomic & Nuclear");
0598 
0599     I18N_CONSTANT(i18n("Bohr Radius"));
0600     I18N_CONSTANT(i18n("Fermi Coupling Constant"));
0601     I18N_CONSTANT(i18n("Fine-structure Constant"));
0602     I18N_CONSTANT(i18n("Hartree Energy"));
0603     I18N_CONSTANT(i18n("Hartree Energy in eV"));
0604     I18N_CONSTANT(i18n("Quantum of Circulation"));
0605     I18N_CONSTANT(i18n("Quantum of Circulation times 2"));
0606     I18N_CONSTANT(i18n("Rydberg Constant"));
0607     I18N_CONSTANT(i18n("Thomson Cross Section"));
0608     I18N_CONSTANT(i18n("Weak Mixing Angle"));
0609 
0610     // CODATA
0611     cat = i18n("Physico-chemical");
0612 
0613     I18N_CONSTANT(i18n("Atomic Mass Unit"));
0614     I18N_CONSTANT(i18n("Avogadro's Number"));
0615     I18N_CONSTANT(i18n("Boltzmann Constant"));
0616     I18N_CONSTANT(i18n("Compton wavelength"));
0617     I18N_CONSTANT(i18n("Compton wavelength over 2 pi"));
0618     I18N_CONSTANT(i18n("Electron volt"));
0619     I18N_CONSTANT(i18n("Faraday Constant"));
0620     I18N_CONSTANT(i18n("First Radiation Constant"));
0621     I18N_CONSTANT(i18n("First Radiation Constant for Spectral Radiance"));
0622     I18N_CONSTANT(i18n("Gas Constant"));
0623     I18N_CONSTANT(i18n("Loschmidt constant (273.15 K, 100 kPa)"));
0624     I18N_CONSTANT(i18n("Loschmidt constant (273.15 K, 101.325 kPa)"));
0625     I18N_CONSTANT(i18n("Molar Planck Constant"));
0626     I18N_CONSTANT(i18n("Second Radiation Constant"));
0627     I18N_CONSTANT(i18n("Stefan-Boltzmann Constant"));
0628     I18N_CONSTANT(i18n("{220} Lattice Spacing of Silicon"));
0629 
0630     // http://www.astronomynotes.com/tables/tablesa.htm
0631     cat = i18n("Astronomy");
0632 
0633     I18N_CONSTANT(i18n("Astronomical Unit"));
0634     I18N_CONSTANT(i18n("Light Year"));
0635     I18N_CONSTANT(i18n("Parsec"));
0636 
0637     const QString days = i18n("days");
0638 
0639     I18N_CONSTANT_DAYS(i18n("Gregorian Year"));
0640     I18N_CONSTANT_DAYS(i18n("Julian Year"));
0641     I18N_CONSTANT_DAYS(i18n("Sidereal Year"));
0642     I18N_CONSTANT_DAYS(i18n("Tropical Year"));
0643 
0644     I18N_CONSTANT(i18n("Earth Mass"));
0645     I18N_CONSTANT(i18n("Mean Earth Radius"));
0646     I18N_CONSTANT(i18n("Sun Mass"));
0647     I18N_CONSTANT(i18n("Sun Radius"));
0648     I18N_CONSTANT(i18n("Sun Luminosity"));
0649 
0650     // http://www.ptable.com/
0651     // Only known constants of accuracy more than an integer are included.
0652     cat = i18n("Molar Mass");
0653 
0654     I18N_CONSTANT(i18n("Aluminium"));
0655     I18N_CONSTANT(i18n("Antimony"));
0656     I18N_CONSTANT(i18n("Argon"));
0657     I18N_CONSTANT(i18n("Arsenic"));
0658     I18N_CONSTANT(i18n("Barium"));
0659     I18N_CONSTANT(i18n("Beryllium"));
0660     I18N_CONSTANT(i18n("Bismuth"));
0661     I18N_CONSTANT(i18n("Boron"));
0662     I18N_CONSTANT(i18n("Bromine"));
0663     I18N_CONSTANT(i18n("Cadmium"));
0664     I18N_CONSTANT(i18n("Caesium"));
0665     I18N_CONSTANT(i18n("Calcium"));
0666     I18N_CONSTANT(i18n("Carbon"));
0667     I18N_CONSTANT(i18n("Cerium"));
0668     I18N_CONSTANT(i18n("Chlorine"));
0669     I18N_CONSTANT(i18n("Chromium"));
0670     I18N_CONSTANT(i18n("Cobalt"));
0671     I18N_CONSTANT(i18n("Copper"));
0672     I18N_CONSTANT(i18n("Dysprosium"));
0673     I18N_CONSTANT(i18n("Erbium"));
0674     I18N_CONSTANT(i18n("Europium"));
0675     I18N_CONSTANT(i18n("Fluorine"));
0676     I18N_CONSTANT(i18n("Gadolinium"));
0677     I18N_CONSTANT(i18n("Gallium"));
0678     I18N_CONSTANT(i18n("Germanium"));
0679     I18N_CONSTANT(i18n("Gold"));
0680     I18N_CONSTANT(i18n("Hafnium"));
0681     I18N_CONSTANT(i18n("Helium"));
0682     I18N_CONSTANT(i18n("Holmium"));
0683     I18N_CONSTANT(i18n("Hydrogen"));
0684     I18N_CONSTANT(i18n("Indium"));
0685     I18N_CONSTANT(i18n("Iodine"));
0686     I18N_CONSTANT(i18n("Iridium"));
0687     I18N_CONSTANT(i18n("Iron"));
0688     I18N_CONSTANT(i18n("Krypton"));
0689     I18N_CONSTANT(i18n("Lanthanum"));
0690     I18N_CONSTANT(i18n("Lead"));
0691     I18N_CONSTANT(i18n("Lithium"));
0692     I18N_CONSTANT(i18n("Lutetium"));
0693     I18N_CONSTANT(i18n("Magnesium"));
0694     I18N_CONSTANT(i18n("Manganese"));
0695     I18N_CONSTANT(i18n("Mercury"));
0696     I18N_CONSTANT(i18n("Molybdenum"));
0697     I18N_CONSTANT(i18n("Neodymium"));
0698     I18N_CONSTANT(i18n("Neon"));
0699     I18N_CONSTANT(i18n("Nickel"));
0700     I18N_CONSTANT(i18n("Niobium"));
0701     I18N_CONSTANT(i18n("Nitrogen"));
0702     I18N_CONSTANT(i18n("Osmium"));
0703     I18N_CONSTANT(i18n("Oxygen"));
0704     I18N_CONSTANT(i18n("Palladium"));
0705     I18N_CONSTANT(i18n("Phosphorus"));
0706     I18N_CONSTANT(i18n("Platinum"));
0707     I18N_CONSTANT(i18n("Potassium"));
0708     I18N_CONSTANT(i18n("Praseodymium"));
0709     I18N_CONSTANT(i18n("Protactinium"));
0710     I18N_CONSTANT(i18n("Rhenium"));
0711     I18N_CONSTANT(i18n("Rubidium"));
0712     I18N_CONSTANT(i18n("Ruthenium"));
0713     I18N_CONSTANT(i18n("Samarium"));
0714     I18N_CONSTANT(i18n("Scandium"));
0715     I18N_CONSTANT(i18n("Selenium"));
0716     I18N_CONSTANT(i18n("Silicon"));
0717     I18N_CONSTANT(i18n("Silver"));
0718     I18N_CONSTANT(i18n("Sodium"));
0719     I18N_CONSTANT(i18n("Strontium"));
0720     I18N_CONSTANT(i18n("Sulfur"));
0721     I18N_CONSTANT(i18n("Tantalum"));
0722     I18N_CONSTANT(i18n("Tellurium"));
0723     I18N_CONSTANT(i18n("Terbium"));
0724     I18N_CONSTANT(i18n("Thallium"));
0725     I18N_CONSTANT(i18n("Thorium"));
0726     I18N_CONSTANT(i18n("Thulium"));
0727     I18N_CONSTANT(i18n("Tin"));
0728     I18N_CONSTANT(i18n("Titanium"));
0729     I18N_CONSTANT(i18n("Tungsten"));
0730     I18N_CONSTANT(i18n("Uranium"));
0731     I18N_CONSTANT(i18n("Vanadium"));
0732     I18N_CONSTANT(i18n("Xenon"));
0733     I18N_CONSTANT(i18n("Ytterbium"));
0734     I18N_CONSTANT(i18n("Yttrium"));
0735     I18N_CONSTANT(i18n("Zinc"));
0736     I18N_CONSTANT(i18n("Zirconium"));
0737 
0738     // K.A. Olive et al. (Particle Data Group), Chin. Phys. C, 38, 090001 (2014).
0739     // http://pdg.lbl.gov/index.html
0740     // CODATA constants
0741     cat = i18n("Particle Masses");
0742 
0743     I18N_CONSTANT(i18n("Electron Mass"));      // CODATA, 2016-03-28
0744     I18N_CONSTANT(i18n("Muon Mass"));          // CODATA, 2016-03-28
0745     I18N_CONSTANT(i18n("Tau Mass"));           // CODATA, 2016-03-28
0746     I18N_CONSTANT(i18n("Up-Quark Mass"));      // Particle Data Group
0747     I18N_CONSTANT(i18n("Down-Quark Mass"));    // Particle Data Group
0748     I18N_CONSTANT(i18n("Charm-Quark Mass"));   // Particle Data Group
0749     I18N_CONSTANT(i18n("Strange-Quark Mass")); // Particle Data Group
0750     I18N_CONSTANT(i18n("Top-Quark Mass"));     // Particle Data Group
0751     I18N_CONSTANT(i18n("Bottom-Quark Mass"));  // Particle Data Group
0752     I18N_CONSTANT(i18n("W-Boson Mass"));       // Particle Data Group
0753     I18N_CONSTANT(i18n("Z-Boson Mass"));       // Particle Data Group
0754     I18N_CONSTANT(i18n("Higgs-Boson Mass"));   // Particle Data Group
0755     I18N_CONSTANT(i18n("Proton Mass"));        // CODATA, 2016-03-28
0756     I18N_CONSTANT(i18n("Neutron Mass"));       // CODATA, 2016-03-28
0757     I18N_CONSTANT(i18n("Electron Mass (SI)")); // CODATA, 2016-03-28
0758     I18N_CONSTANT(i18n("Proton Mass (SI)"));   // CODATA, 2016-03-28
0759     I18N_CONSTANT(i18n("Neutron Mass (SI)"));  // CODATA, 2016-03-28
0760 
0761     categories.clear();
0762     for (int k = 0; k < list.count(); ++k)
0763         if (!categories.contains(list.at(k).category))
0764             categories += list.at(k).category;
0765     categories.sort();
0766 }
0767 
0768 Constants* Constants::instance()
0769 {
0770     if (!s_constantsInstance) {
0771         s_constantsInstance = new Constants;
0772         qAddPostRoutine(s_deleteConstants);
0773     }
0774     return s_constantsInstance;
0775 }
0776 
0777 Constants::Constants()
0778     : d(new Constants::Private)
0779 {
0780     setObjectName("Constants");
0781     d->populate();
0782     d->retranslateText();
0783 }
0784 
0785 const QList<Constant>& Constants::list() const
0786 {
0787     return d->list;
0788 }
0789 
0790 const QStringList& Constants::categories() const
0791 {
0792     return d->categories;
0793 }
0794 
0795 void Constants::retranslateText()
0796 {
0797     d->retranslateText();
0798 }
0799 
0800 Constants::~Constants()
0801 {
0802 }
0803