1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . D I M . M K S --
9 -- Copyright (C) 2011-2012, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 -- Defines the MKS dimension system which is the SI system of units
34 -- Some other prefixes of this system are defined in a child package (see
35 -- System.Dim_Mks.Other_Prefixes) in order to avoid too many constant
36 -- declarations in this package.
38 -- The dimension terminology is defined in System.Dim_IO package
42 package System.Dim.Mks is
44 e : constant := Ada.Numerics.e;
45 Pi : constant := Ada.Numerics.Pi;
47 -- Dimensioned type Mks_Type
49 type Mks_Type is new Long_Long_Float
51 Dimension_System => ((Meter, 'm'),
59 -- SI Base dimensioned subtype
61 subtype Length is Mks_Type
66 subtype Mass is Mks_Type
71 subtype Time is Mks_Type
76 subtype Electric_Current is Mks_Type
81 subtype Thermodynamic_Temperature is Mks_Type
86 subtype Amount_Of_Substance is Mks_Type
91 subtype Luminous_Intensity is Mks_Type
99 m : constant Length := 1.0;
100 kg : constant Mass := 1.0;
101 s : constant Time := 1.0;
102 A : constant Electric_Current := 1.0;
103 K : constant Thermodynamic_Temperature := 1.0;
104 mol : constant Amount_Of_Substance := 1.0;
105 cd : constant Luminous_Intensity := 1.0;
107 -- SI Derived dimensioned subtypes
109 subtype Angle is Mks_Type
114 subtype Solid_Angle is Mks_Type
119 subtype Frequency is Mks_Type
124 subtype Force is Mks_Type
131 subtype Pressure is Mks_Type
138 subtype Energy is Mks_Type
145 subtype Power is Mks_Type
152 subtype Electric_Charge is Mks_Type
158 subtype Electric_Potential_Difference is Mks_Type
166 subtype Electric_Capacitance is Mks_Type
174 subtype Electric_Resistance is Mks_Type
182 subtype Electric_Conductance is Mks_Type
190 subtype Magnetic_Flux is Mks_Type
198 subtype Magnetic_Flux_Density is Mks_Type
205 subtype Inductance is Mks_Type
213 subtype Celsius_Temperature is Mks_Type
218 subtype Luminous_Flux is Mks_Type
223 subtype Illuminance is Mks_Type
229 subtype Radioactivity is Mks_Type
234 subtype Absorbed_Dose is Mks_Type
240 subtype Equivalent_Dose is Mks_Type
246 subtype Catalytic_Activity is Mks_Type
253 rad : constant Angle := 1.0;
254 sr : constant Solid_Angle := 1.0;
255 Hz : constant Frequency := 1.0;
256 N : constant Force := 1.0;
257 Pa : constant Pressure := 1.0;
258 J : constant Energy := 1.0;
259 W : constant Power := 1.0;
260 C : constant Electric_Charge := 1.0;
261 V : constant Electric_Potential_Difference := 1.0;
262 F : constant Electric_Capacitance := 1.0;
263 Ohm : constant Electric_Resistance := 1.0;
264 Si : constant Electric_Conductance := 1.0;
265 Wb : constant Magnetic_Flux := 1.0;
266 T : constant Magnetic_Flux_Density := 1.0;
267 H : constant Inductance := 1.0;
268 dC : constant Celsius_Temperature := 273.15;
269 lm : constant Luminous_Flux := 1.0;
270 lx : constant Illuminance := 1.0;
271 Bq : constant Radioactivity := 1.0;
272 Gy : constant Absorbed_Dose := 1.0;
273 Sv : constant Equivalent_Dose := 1.0;
274 kat : constant Catalytic_Activity := 1.0;
276 -- SI prefixes for Meter
278 um : constant Length := 1.0E-06; -- micro (u)
279 mm : constant Length := 1.0E-03; -- milli
280 cm : constant Length := 1.0E-02; -- centi
281 dm : constant Length := 1.0E-01; -- deci
282 dam : constant Length := 1.0E+01; -- deka
283 hm : constant Length := 1.0E+02; -- hecto
284 km : constant Length := 1.0E+03; -- kilo
285 Mem : constant Length := 1.0E+06; -- mega
287 -- SI prefixes for Kilogram
289 ug : constant Mass := 1.0E-09; -- micro (u)
290 mg : constant Mass := 1.0E-06; -- milli
291 cg : constant Mass := 1.0E-05; -- centi
292 dg : constant Mass := 1.0E-04; -- deci
293 g : constant Mass := 1.0E-03; -- gram
294 dag : constant Mass := 1.0E-02; -- deka
295 hg : constant Mass := 1.0E-01; -- hecto
296 Meg : constant Mass := 1.0E+03; -- mega
298 -- SI prefixes for Second
300 us : constant Time := 1.0E-06; -- micro (u)
301 ms : constant Time := 1.0E-03; -- milli
302 cs : constant Time := 1.0E-02; -- centi
303 ds : constant Time := 1.0E-01; -- deci
304 das : constant Time := 1.0E+01; -- deka
305 hs : constant Time := 1.0E+02; -- hecto
306 ks : constant Time := 1.0E+03; -- kilo
307 Mes : constant Time := 1.0E+06; -- mega
309 -- Other constants for Second
311 min : constant Time := 60.0 * s;
312 hour : constant Time := 60.0 * min;
313 day : constant Time := 24.0 * hour;
314 year : constant Time := 365.25 * day;
316 -- SI prefixes for Ampere
318 mA : constant Electric_Current := 1.0E-03; -- milli
319 cA : constant Electric_Current := 1.0E-02; -- centi
320 dA : constant Electric_Current := 1.0E-01; -- deci
321 daA : constant Electric_Current := 1.0E+01; -- deka
322 hA : constant Electric_Current := 1.0E+02; -- hecto
323 kA : constant Electric_Current := 1.0E+03; -- kilo
324 MeA : constant Electric_Current := 1.0E+06; -- mega