1 ------------------------------------------------------------------------------
3 -- GNAT RUN-TIME COMPONENTS --
5 -- S Y S T E M . D I M _ M K S --
9 -- Copyright (C) 2011, 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.
40 package System.Dim_Mks is
42 e : constant := Ada.Numerics.e;
43 Pi : constant := Ada.Numerics.Pi;
45 -- Dimensioned type Mks_Type
47 type Mks_Type is new Long_Float
49 Dimension_System => ((Meter, 'm'),
59 subtype Length is Mks_Type
64 subtype Mass is Mks_Type
69 subtype Time is Mks_Type
74 subtype Electric_Current is Mks_Type
79 subtype Thermodynamic_Temperature is Mks_Type
84 subtype Amount_Of_Substance is Mks_Type
89 subtype Luminous_Intensity is Mks_Type
97 m : constant Length := 1.0;
98 kg : constant Mass := 1.0;
99 s : constant Time := 1.0;
100 A : constant Electric_Current := 1.0;
101 K : constant Thermodynamic_Temperature := 1.0;
102 mol : constant Amount_Of_Substance := 1.0;
103 cd : constant Luminous_Intensity := 1.0;
105 -- SI Derived dimensioned subtypes
107 subtype Angle is Mks_Type
112 subtype Solid_Angle is Mks_Type
117 subtype Frequency is Mks_Type
122 subtype Force is Mks_Type
129 subtype Pressure is Mks_Type
136 subtype Energy is Mks_Type
143 subtype Power is Mks_Type
150 subtype Electric_Charge is Mks_Type
156 subtype Electric_Potential_Difference is Mks_Type
164 subtype Electric_Capacitance is Mks_Type
172 subtype Electric_Resistance is Mks_Type
180 subtype Electric_Conductance is Mks_Type
188 subtype Magnetic_Flux is Mks_Type
196 subtype Magnetic_Flux_Density is Mks_Type
203 subtype Inductance is Mks_Type
211 subtype Celsius_Temperature is Mks_Type
216 subtype Luminous_Flux is Mks_Type
221 subtype Illuminance is Mks_Type
227 subtype Radioactivity is Mks_Type
232 subtype Absorbed_Dose is Mks_Type
238 subtype Equivalent_Dose is Mks_Type
244 subtype Catalytic_Activity is Mks_Type
251 rad : constant Angle := 1.0;
252 sr : constant Solid_Angle := 1.0;
253 Hz : constant Frequency := 1.0;
254 N : constant Force := 1.0;
255 Pa : constant Pressure := 1.0;
256 J : constant Energy := 1.0;
257 W : constant Power := 1.0;
258 C : constant Electric_Charge := 1.0;
259 V : constant Electric_Potential_Difference := 1.0;
260 F : constant Electric_Capacitance := 1.0;
261 Ohm : constant Electric_Resistance := 1.0;
262 Si : constant Electric_Conductance := 1.0;
263 Wb : constant Magnetic_Flux := 1.0;
264 T : constant Magnetic_Flux_Density := 1.0;
265 H : constant Inductance := 1.0;
266 dC : constant Celsius_Temperature := 273.15;
267 lm : constant Luminous_Flux := 1.0;
268 lx : constant Illuminance := 1.0;
269 Bq : constant Radioactivity := 1.0;
270 Gy : constant Absorbed_Dose := 1.0;
271 Sv : constant Equivalent_Dose := 1.0;
272 kat : constant Catalytic_Activity := 1.0;
274 -- SI prefixes for Meter
276 um : constant Length := 1.0E-06; -- micro (u)
277 mm : constant Length := 1.0E-03; -- milli
278 cm : constant Length := 1.0E-02; -- centi
279 dm : constant Length := 1.0E-01; -- deci
280 dam : constant Length := 1.0E+01; -- deka
281 hm : constant Length := 1.0E+02; -- hecto
282 km : constant Length := 1.0E+03; -- kilo
283 Mem : constant Length := 1.0E+06; -- mega
285 -- SI prefixes for Kilogram
287 ug : constant Mass := 1.0E-09; -- micro (u)
288 mg : constant Mass := 1.0E-06; -- milli
289 cg : constant Mass := 1.0E-05; -- centi
290 dg : constant Mass := 1.0E-04; -- deci
291 g : constant Mass := 1.0E-03; -- gram
292 dag : constant Mass := 1.0E-02; -- deka
293 hg : constant Mass := 1.0E-01; -- hecto
294 Meg : constant Mass := 1.0E+03; -- mega
296 -- SI prefixes for Second
298 us : constant Time := 1.0E-06; -- micro (u)
299 ms : constant Time := 1.0E-03; -- milli
300 cs : constant Time := 1.0E-02; -- centi
301 ds : constant Time := 1.0E-01; -- deci
302 das : constant Time := 1.0E+01; -- deka
303 hs : constant Time := 1.0E+02; -- hecto
304 ks : constant Time := 1.0E+03; -- kilo
305 Mes : constant Time := 1.0E+06; -- mega
307 -- Other constants for Second
309 min : constant Time := 60.0 * s;
310 hour : constant Time := 60.0 * min;
311 day : constant Time := 24.0 * hour;
312 year : constant Time := 365.25 * day;
314 -- SI prefixes for Ampere
316 mA : constant Electric_Current := 1.0E-03; -- milli
317 cA : constant Electric_Current := 1.0E-02; -- centi
318 dA : constant Electric_Current := 1.0E-01; -- deci
319 daA : constant Electric_Current := 1.0E+01; -- deka
320 hA : constant Electric_Current := 1.0E+02; -- hecto
321 kA : constant Electric_Current := 1.0E+03; -- kilo
322 MeA : constant Electric_Current := 1.0E+06; -- mega