Changeset 641

Show
Ignore:
Timestamp:
09/21/2007 06:50:35 AM (16 months ago)
Author:
otter
Message:

Added "final" to all constants of Modelica.Constants (reported by Christoph Richter)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Modelica/trunk/Modelica/Constants.mo

    r550 r641  
    99   
    1010  // Mathematical constants 
    11   constant Real e=Modelica.Math.exp(1.0); 
    12   constant Real pi=2*Modelica.Math.asin(1.0); // 3.14159265358979; 
    13   constant Real D2R=pi/180 "Degree to Radian"; 
    14   constant Real R2D=180/pi "Radian to Degree"; 
     11  final constant Real e=Modelica.Math.exp(1.0); 
     12  final constant Real pi=2*Modelica.Math.asin(1.0); // 3.14159265358979; 
     13  final constant Real D2R=pi/180 "Degree to Radian"; 
     14  final constant Real R2D=180/pi "Radian to Degree"; 
    1515   
    1616  // Machine dependent constants 
    1717  // (the definition is a temporary fix since not adapted to the 
    1818  // machine where the Modelica translator is running) 
    19   constant Real eps=1.e-15 "Biggest number such that 1.0 + eps = 1.0"; 
    20   constant Real small=1.e-60  
     19  final constant Real eps=1.e-15 "Biggest number such that 1.0 + eps = 1.0"; 
     20  final constant Real small=1.e-60  
    2121    "Smallest number such that small and -small are representable on the machine"; 
    22   constant Real inf=1.e+60  
     22  final constant Real inf=1.e+60  
    2323    "Biggest Real number such that inf and -inf are representable on the machine"; 
    24   constant Integer Integer_inf=2147483647  
     24  final constant Integer Integer_inf=2147483647  
    2525    "Biggest Integer number such that Integer_inf and -Integer_inf are representable on the machine"; 
    2626   
    2727  // Constants of nature 
    2828  // (name, value, description from http://physics.nist.gov/cuu/Constants/) 
    29   constant SI.Velocity c=299792458 "Speed of light in vacuum"; 
    30   constant SI.Acceleration g_n=9.80665  
     29  final constant SI.Velocity c=299792458 "Speed of light in vacuum"; 
     30  final constant SI.Acceleration g_n=9.80665  
    3131    "Standard acceleration of gravity on earth"; 
    32   constant Real G(final unit="m3/(kg.s2)") = 6.6742e-11  
     32  final constant Real G(final unit="m3/(kg.s2)") = 6.6742e-11  
    3333    "Newtonian constant of gravitation"; 
    34   constant Real h(final unit="J.s") = 6.6260693e-34 "Planck constant"; 
    35   constant Real k(final unit="J/K") = 1.3806505e-23 "Boltzmann constant"; 
    36   constant Real R(final unit="J/(mol.K)") = 8.314472 "Molar gas constant"; 
    37   constant Real sigma(final unit="W/(m2.K4)") = 5.670400e-8  
     34  final constant Real h(final unit="J.s") = 6.6260693e-34 "Planck constant"; 
     35  final constant Real k(final unit="J/K") = 1.3806505e-23 "Boltzmann constant"; 
     36  final constant Real R(final unit="J/(mol.K)") = 8.314472 "Molar gas constant"; 
     37  final constant Real sigma(final unit="W/(m2.K4)") = 5.670400e-8  
    3838    "Stefan-Boltzmann constant"; 
    39   constant Real N_A(final unit="1/mol") = 6.0221415e23 "Avogadro constant"; 
    40   constant Real mue_0(final unit="N/A2") = 4*pi*1.e-7 "Magnetic constant"; 
    41   constant Real epsilon_0(final unit="F/m") = 1/(mue_0*c*c) "Electric constant"; 
    42   constant NonSI.Temperature_degC T_zero=-273.15 "Absolute zero temperature"; 
     39  final constant Real N_A(final unit="1/mol") = 6.0221415e23  
     40    "Avogadro constant"; 
     41  final constant Real mue_0(final unit="N/A2") = 4*pi*1.e-7 "Magnetic constant"; 
     42  final constant Real epsilon_0(final unit="F/m") = 1/(mue_0*c*c)  
     43    "Electric constant"; 
     44  final constant NonSI.Temperature_degC T_zero=-273.15  
     45    "Absolute zero temperature"; 
    4346   
    4447  annotation (