Commit c4b9b291 by Yannick Moy Committed by Pierre-Marie de Rodat

[Ada] Define versions of dimension system for Float and Long_Float

The dimension system in System.Dim.Mks is based on Long_Long_Float,
which may not be convenient to people who want to use Float or
Long_Float as basis. These new files provide units that define the
dimension system based on Float in System.Dim.Float_Mks and on
Long_Float in System.Dim.Long_Mks.

Child packages Other_Prefixes and Mks_IO are also defined appropriately,
with new instantiations for the various sizes of floating-point types.

2018-08-21  Yannick Moy  <moy@adacore.com>

gcc/ada/

	* doc/gnat_ugn/gnat_and_program_execution.rst: Update
	documentation of dimensionality analysis.
	* gnat_ugn.texi: Regenerate.
	* Makefile.rtl, impunit.adb: Consider the new units.
	* libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
	libgnat/s-diflmk.ads: New units based on Float.
	* libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
	libgnat/s-dlmopr.ads: New units based on Long_Float.
	* libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
	into an instance of
	System.Dim.Generic_Mks.Generic_Other_Prefixes.
	* libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
	into an instance of System.Dim.Generic_Mks.

From-SVN: r263715
parent 2201fa7b
2018-08-21 Yannick Moy <moy@adacore.com>
* doc/gnat_ugn/gnat_and_program_execution.rst: Update
documentation of dimensionality analysis.
* gnat_ugn.texi: Regenerate.
* Makefile.rtl, impunit.adb: Consider the new units.
* libgnat/s-dfmkio.ads, libgnat/s-dfmopr.ads,
libgnat/s-diflmk.ads: New units based on Float.
* libgnat/s-dilomk.ads, libgnat/s-dlmkio.ads,
libgnat/s-dlmopr.ads: New units based on Long_Float.
* libgnat/s-dmotpr.ads: Rename to libgnat/s-dgmgop.ads and turn
into an instance of
System.Dim.Generic_Mks.Generic_Other_Prefixes.
* libgnat/s-dimmks.ads: Rename to libgnat/s-digemk.ads and turn
into an instance of System.Dim.Generic_Mks.
2018-08-21 Hristian Kirtchev <kirtchev@adacore.com>
* impunit.adb: Add g-lists to the set of non-implementation
......
......@@ -523,12 +523,20 @@ GNATRTL_NONTASKING_OBJS= \
s-conca9$(objext) \
s-crc32$(objext) \
s-crtl$(objext) \
s-dfmkio$(objext) \
s-dfmopr$(objext) \
s-dgmgop$(objext) \
s-dlmopr$(objext) \
s-diflio$(objext) \
s-diflmk$(objext) \
s-digemk$(objext) \
s-diinio$(objext) \
s-dilomk$(objext) \
s-dim$(objext) \
s-dimkio$(objext) \
s-dimmks$(objext) \
s-direio$(objext) \
s-dlmkio$(objext) \
s-dmotpr$(objext) \
s-dsaser$(objext) \
s-elaall$(objext) \
......@@ -2762,4 +2770,3 @@ a-tags.o : a-tags.adb a-tags.ads
s-memory.o : s-memory.adb s-memory.ads
$(ADAC) -c $(ALL_ADAFLAGS) $(NO_SIBLING_ADAFLAGS) $(ADA_INCLUDES) \
$< $(OUTPUT_OPTION)
......@@ -3280,19 +3280,18 @@ to use the proper subtypes in object declarations.
.. index:: MKS_Type type
The simplest way to impose dimensionality checking on a computation is to make
use of the package ``System.Dim.Mks``,
which is part of the GNAT library. This
package defines a floating-point type ``MKS_Type``,
for which a sequence of
dimension names are specified, together with their conventional abbreviations.
The following should be read together with the full specification of the
package, in file :file:`s-dimmks.ads`.
use of one of the instantiations of the package ``System.Dim.Generic_Mks``, which
are part of the GNAT library. This generic package defines a floating-point
type ``MKS_Type``, for which a sequence of dimension names are specified,
together with their conventional abbreviations. The following should be read
together with the full specification of the package, in file
:file:`s-digemk.ads`.
.. index:: s-dimmks.ads file
.. index:: s-digemk.ads file
.. code-block:: ada
type Mks_Type is new Long_Long_Float
type Mks_Type is new Float_Type
with
Dimension_System => (
(Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
......@@ -3336,10 +3335,16 @@ as well as useful multiples of these units:
day : constant Time := 60.0 * 24.0 * min;
...
Using this package, you can then define a derived unit by
providing the aspect that
specifies its dimensions within the MKS system, as well as the string to
be used for output of a value of that unit:
There are three instantiations of ``System.Dim.Generic_Mks`` defined in the
GNAT library:
* ``System.Dim.Float_Mks`` based on ``Float`` defined in :file:`s-diflmk.ads`.
* ``System.Dim.Long_Mks`` based on ``Long_Float`` defined in :file:`s-dilomk.ads`.
* ``System.Dim.Mks`` based on ``Long_Long_Float`` defined in :file:`s-dimmks.ads`.
Using one of these packages, you can then define a derived unit by providing
the aspect that specifies its dimensions within the MKS system, as well as the
string to be used for output of a value of that unit:
.. code-block:: ada
......
......@@ -21,7 +21,7 @@
@copying
@quotation
GNAT User's Guide for Native Platforms , Jul 13, 2018
GNAT User's Guide for Native Platforms , Aug 17, 2018
AdaCore
......@@ -22606,20 +22606,19 @@ to use the proper subtypes in object declarations.
@geindex MKS_Type type
The simplest way to impose dimensionality checking on a computation is to make
use of the package @code{System.Dim.Mks},
which is part of the GNAT library. This
package defines a floating-point type @code{MKS_Type},
for which a sequence of
dimension names are specified, together with their conventional abbreviations.
The following should be read together with the full specification of the
package, in file @code{s-dimmks.ads}.
use of one of the instantiations of the package @code{System.Dim.Generic_Mks}, which
are part of the GNAT library. This generic package defines a floating-point
type @code{MKS_Type}, for which a sequence of dimension names are specified,
together with their conventional abbreviations. The following should be read
together with the full specification of the package, in file
@code{s-digemk.ads}.
@quotation
@geindex s-dimmks.ads file
@geindex s-digemk.ads file
@example
type Mks_Type is new Long_Long_Float
type Mks_Type is new Float_Type
with
Dimension_System => (
(Unit_Name => Meter, Unit_Symbol => 'm', Dim_Symbol => 'L'),
......@@ -22674,10 +22673,25 @@ as well as useful multiples of these units:
@end example
@end quotation
Using this package, you can then define a derived unit by
providing the aspect that
specifies its dimensions within the MKS system, as well as the string to
be used for output of a value of that unit:
There are three instantiations of @code{System.Dim.Generic_Mks} defined in the
GNAT library:
@itemize *
@item
@code{System.Dim.Float_Mks} based on @code{Float} defined in @code{s-diflmk.ads}.
@item
@code{System.Dim.Long_Mks} based on @code{Long_Float} defined in @code{s-dilomk.ads}.
@item
@code{System.Dim.Mks} based on @code{Long_Long_Float} defined in @code{s-dimmks.ads}.
@end itemize
Using one of these packages, you can then define a derived unit by providing
the aspect that specifies its dimensions within the MKS system, as well as the
string to be used for output of a value of that unit:
@quotation
......
......@@ -373,10 +373,18 @@ package body Impunit is
("s-addima", F), -- System.Address_Image
("s-atocou", F), -- System.Atomic_Counters
("s-assert", F), -- System.Assertions
("s-dfmkio", F), -- System.Dim.Float_Mks_IO
("s-dfmopr", F), -- System.Dim.Float_Mks.Other_Prefixes
("s-dgmgop", F), -- System.Dim.Generic_Mks.Generic_Other_Prefixes
("s-dlmopr", F), -- System.Dim.Long_Mks.Other_Prefixes
("s-diflio", F), -- System.Dim.Float_IO
("s-diflmk", F), -- System.Dim.Float_Mks
("s-digemk", F), -- System.Dim.Generic_Mks
("s-diinio", F), -- System.Dim.Integer_IO
("s-dilomk", F), -- System.Dim.Long_Mks
("s-dimkio", F), -- System.Dim.Mks_IO
("s-dimmks", F), -- System.Dim.Mks
("s-dlmkio", F), -- System.Dim.Long_Mks_IO
("s-dmotpr", F), -- System.Dim.Mks.Other_Prefixes
("s-memory", F), -- System.Memory
("s-parint", F), -- System.Partition_Interface
......
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . F L O A T _ M K S _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Provides output facilities for the Float MKS dimension system (see
-- System.Dim.Float_Mks and System.Dim.Float_IO).
with System.Dim.Float_Mks; use System.Dim.Float_Mks;
with System.Dim.Float_IO;
package System.Dim.Float_Mks_IO is new System.Dim.Float_IO (Mks_Type);
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . F L O A T _ M K S . O T H E R _ P R E F I X E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Dim.Generic_Mks.Generic_Other_Prefixes;
package System.Dim.Float_Mks.Other_Prefixes is
new System.Dim.Float_Mks.Generic_Other_Prefixes;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . G E N E R I C _ M K S --
-- . G E N E R I C _ O T H E R _ P R E F I X E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2011-2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Package that defines some other prefixes for the MKS base unit system.
-- These prefixes have been defined in a child package in order to avoid too
-- many constant declarations in System.Dim.Generic_Mks.
generic
package System.Dim.Generic_Mks.Generic_Other_Prefixes is
-- SI prefixes for Meter
pragma Warnings (Off);
-- Turn off the all the dimension warnings
ym : constant Length := 1.0E-24; -- yocto
zm : constant Length := 1.0E-21; -- zepto
am : constant Length := 1.0E-18; -- atto
fm : constant Length := 1.0E-15; -- femto
pm : constant Length := 1.0E-12; -- pico
nm : constant Length := 1.0E-09; -- nano
Gm : constant Length := 1.0E+09; -- giga
Tm : constant Length := 1.0E+12; -- tera
Pem : constant Length := 1.0E+15; -- peta
Em : constant Length := 1.0E+18; -- exa
Zem : constant Length := 1.0E+21; -- zetta
Yom : constant Length := 1.0E+24; -- yotta
-- SI prefixes for Kilogram
yg : constant Mass := 1.0E-27; -- yocto
zg : constant Mass := 1.0E-24; -- zepto
ag : constant Mass := 1.0E-21; -- atto
fg : constant Mass := 1.0E-18; -- femto
pg : constant Mass := 1.0E-15; -- pico
ng : constant Mass := 1.0E-12; -- nano
Gg : constant Mass := 1.0E+06; -- giga
Tg : constant Mass := 1.0E+09; -- tera
Peg : constant Mass := 1.0E+13; -- peta
Eg : constant Mass := 1.0E+15; -- exa
Zeg : constant Mass := 1.0E+18; -- zetta
Yog : constant Mass := 1.0E+21; -- yotta
-- SI prefixes for Second
ys : constant Time := 1.0E-24; -- yocto
zs : constant Time := 1.0E-21; -- zepto
as : constant Time := 1.0E-18; -- atto
fs : constant Time := 1.0E-15; -- femto
ps : constant Time := 1.0E-12; -- pico
ns : constant Time := 1.0E-09; -- nano
Gs : constant Time := 1.0E+09; -- giga
Ts : constant Time := 1.0E+12; -- tera
Pes : constant Time := 1.0E+15; -- peta
Es : constant Time := 1.0E+18; -- exa
Zes : constant Time := 1.0E+21; -- zetta
Yos : constant Time := 1.0E+24; -- yotta
-- SI prefixes for Ampere
yA : constant Electric_Current := 1.0E-24; -- yocto
zA : constant Electric_Current := 1.0E-21; -- zepto
aA : constant Electric_Current := 1.0E-18; -- atto
fA : constant Electric_Current := 1.0E-15; -- femto
nA : constant Electric_Current := 1.0E-09; -- nano
uA : constant Electric_Current := 1.0E-06; -- micro (u)
GA : constant Electric_Current := 1.0E+09; -- giga
TA : constant Electric_Current := 1.0E+12; -- tera
PeA : constant Electric_Current := 1.0E+15; -- peta
EA : constant Electric_Current := 1.0E+18; -- exa
ZeA : constant Electric_Current := 1.0E+21; -- zetta
YoA : constant Electric_Current := 1.0E+24; -- yotta
-- SI prefixes for Kelvin
yK : constant Thermodynamic_Temperature := 1.0E-24; -- yocto
zK : constant Thermodynamic_Temperature := 1.0E-21; -- zepto
aK : constant Thermodynamic_Temperature := 1.0E-18; -- atto
fK : constant Thermodynamic_Temperature := 1.0E-15; -- femto
pK : constant Thermodynamic_Temperature := 1.0E-12; -- pico
nK : constant Thermodynamic_Temperature := 1.0E-09; -- nano
uK : constant Thermodynamic_Temperature := 1.0E-06; -- micro (u)
mK : constant Thermodynamic_Temperature := 1.0E-03; -- milli
cK : constant Thermodynamic_Temperature := 1.0E-02; -- centi
dK : constant Thermodynamic_Temperature := 1.0E-01; -- deci
daK : constant Thermodynamic_Temperature := 1.0E+01; -- deka
hK : constant Thermodynamic_Temperature := 1.0E+02; -- hecto
kK : constant Thermodynamic_Temperature := 1.0E+03; -- kilo
MeK : constant Thermodynamic_Temperature := 1.0E+06; -- mega
GK : constant Thermodynamic_Temperature := 1.0E+09; -- giga
TK : constant Thermodynamic_Temperature := 1.0E+12; -- tera
PeK : constant Thermodynamic_Temperature := 1.0E+15; -- peta
EK : constant Thermodynamic_Temperature := 1.0E+18; -- exa
ZeK : constant Thermodynamic_Temperature := 1.0E+21; -- zetta
YoK : constant Thermodynamic_Temperature := 1.0E+24; -- yotta
-- SI prefixes for Mole
ymol : constant Amount_Of_Substance := 1.0E-24; -- yocto
zmol : constant Amount_Of_Substance := 1.0E-21; -- zepto
amol : constant Amount_Of_Substance := 1.0E-18; -- atto
fmol : constant Amount_Of_Substance := 1.0E-15; -- femto
pmol : constant Amount_Of_Substance := 1.0E-12; -- pico
nmol : constant Amount_Of_Substance := 1.0E-09; -- nano
umol : constant Amount_Of_Substance := 1.0E-06; -- micro (u)
mmol : constant Amount_Of_Substance := 1.0E-03; -- milli
cmol : constant Amount_Of_Substance := 1.0E-02; -- centi
dmol : constant Amount_Of_Substance := 1.0E-01; -- deci
damol : constant Amount_Of_Substance := 1.0E+01; -- deka
hmol : constant Amount_Of_Substance := 1.0E+02; -- hecto
kmol : constant Amount_Of_Substance := 1.0E+03; -- kilo
Memol : constant Amount_Of_Substance := 1.0E+06; -- mega
Gmol : constant Amount_Of_Substance := 1.0E+09; -- giga
Tmol : constant Amount_Of_Substance := 1.0E+12; -- tera
Pemol : constant Amount_Of_Substance := 1.0E+15; -- peta
Emol : constant Amount_Of_Substance := 1.0E+18; -- exa
Zemol : constant Amount_Of_Substance := 1.0E+21; -- zetta
Yomol : constant Amount_Of_Substance := 1.0E+24; -- yotta
-- SI prefixes for Candela
ycd : constant Luminous_Intensity := 1.0E-24; -- yocto
zcd : constant Luminous_Intensity := 1.0E-21; -- zepto
acd : constant Luminous_Intensity := 1.0E-18; -- atto
fcd : constant Luminous_Intensity := 1.0E-15; -- femto
pcd : constant Luminous_Intensity := 1.0E-12; -- pico
ncd : constant Luminous_Intensity := 1.0E-09; -- nano
ucd : constant Luminous_Intensity := 1.0E-06; -- micro (u)
mcd : constant Luminous_Intensity := 1.0E-03; -- milli
ccd : constant Luminous_Intensity := 1.0E-02; -- centi
dcd : constant Luminous_Intensity := 1.0E-01; -- deci
dacd : constant Luminous_Intensity := 1.0E+01; -- deka
hcd : constant Luminous_Intensity := 1.0E+02; -- hecto
kcd : constant Luminous_Intensity := 1.0E+03; -- kilo
Mecd : constant Luminous_Intensity := 1.0E+06; -- mega
Gcd : constant Luminous_Intensity := 1.0E+09; -- giga
Tcd : constant Luminous_Intensity := 1.0E+12; -- tera
Pecd : constant Luminous_Intensity := 1.0E+15; -- peta
Ecd : constant Luminous_Intensity := 1.0E+18; -- exa
Zecd : constant Luminous_Intensity := 1.0E+21; -- zetta
Yocd : constant Luminous_Intensity := 1.0E+24; -- yotta
pragma Warnings (On);
end System.Dim.Generic_Mks.Generic_Other_Prefixes;
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . F L O A T _ M K S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Dim.Generic_Mks;
package System.Dim.Float_Mks is new System.Dim.Generic_Mks (Float);
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . L O N G _ M K S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Dim.Generic_Mks;
package System.Dim.Long_Mks is new System.Dim.Generic_Mks (Long_Float);
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . L O N G _ M K S _ I O --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- Provides output facilities for the Long_Float MKS dimension system (see
-- System.Dim.Long_Mks and System.Dim.Float_IO).
with System.Dim.Long_Mks; use System.Dim.Long_Mks;
with System.Dim.Float_IO;
package System.Dim.Long_Mks_IO is new System.Dim.Float_IO (Mks_Type);
------------------------------------------------------------------------------
-- --
-- GNAT RUN-TIME COMPONENTS --
-- --
-- S Y S T E M . D I M . L O N G _ M K S . O T H E R _ P R E F I X E S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2018, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 3, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. --
-- --
-- As a special exception under Section 7 of GPL version 3, you are granted --
-- additional permissions described in the GCC Runtime Library Exception, --
-- version 3.1, as published by the Free Software Foundation. --
-- --
-- You should have received a copy of the GNU General Public License and --
-- a copy of the GCC Runtime Library Exception along with this program; --
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
with System.Dim.Generic_Mks.Generic_Other_Prefixes;
package System.Dim.Long_Mks.Other_Prefixes is
new System.Dim.Long_Mks.Generic_Other_Prefixes;
......@@ -29,144 +29,7 @@
-- --
------------------------------------------------------------------------------
-- Package that defines some other prefixes for the MKS base unit system.
-- These prefixes have been defined in a child package in order to avoid too
-- many constant declarations in System.Dim_Mks.
with System.Dim.Generic_Mks.Generic_Other_Prefixes;
package System.Dim.Mks.Other_Prefixes is
-- SI prefixes for Meter
pragma Warnings (Off);
-- Turn off the all the dimension warnings
ym : constant Length := 1.0E-24; -- yocto
zm : constant Length := 1.0E-21; -- zepto
am : constant Length := 1.0E-18; -- atto
fm : constant Length := 1.0E-15; -- femto
pm : constant Length := 1.0E-12; -- pico
nm : constant Length := 1.0E-09; -- nano
Gm : constant Length := 1.0E+09; -- giga
Tm : constant Length := 1.0E+12; -- tera
Pem : constant Length := 1.0E+15; -- peta
Em : constant Length := 1.0E+18; -- exa
Zem : constant Length := 1.0E+21; -- zetta
Yom : constant Length := 1.0E+24; -- yotta
-- SI prefixes for Kilogram
yg : constant Mass := 1.0E-27; -- yocto
zg : constant Mass := 1.0E-24; -- zepto
ag : constant Mass := 1.0E-21; -- atto
fg : constant Mass := 1.0E-18; -- femto
pg : constant Mass := 1.0E-15; -- pico
ng : constant Mass := 1.0E-12; -- nano
Gg : constant Mass := 1.0E+06; -- giga
Tg : constant Mass := 1.0E+09; -- tera
Peg : constant Mass := 1.0E+13; -- peta
Eg : constant Mass := 1.0E+15; -- exa
Zeg : constant Mass := 1.0E+18; -- zetta
Yog : constant Mass := 1.0E+21; -- yotta
-- SI prefixes for Second
ys : constant Time := 1.0E-24; -- yocto
zs : constant Time := 1.0E-21; -- zepto
as : constant Time := 1.0E-18; -- atto
fs : constant Time := 1.0E-15; -- femto
ps : constant Time := 1.0E-12; -- pico
ns : constant Time := 1.0E-09; -- nano
Gs : constant Time := 1.0E+09; -- giga
Ts : constant Time := 1.0E+12; -- tera
Pes : constant Time := 1.0E+15; -- peta
Es : constant Time := 1.0E+18; -- exa
Zes : constant Time := 1.0E+21; -- zetta
Yos : constant Time := 1.0E+24; -- yotta
-- SI prefixes for Ampere
yA : constant Electric_Current := 1.0E-24; -- yocto
zA : constant Electric_Current := 1.0E-21; -- zepto
aA : constant Electric_Current := 1.0E-18; -- atto
fA : constant Electric_Current := 1.0E-15; -- femto
nA : constant Electric_Current := 1.0E-09; -- nano
uA : constant Electric_Current := 1.0E-06; -- micro (u)
GA : constant Electric_Current := 1.0E+09; -- giga
TA : constant Electric_Current := 1.0E+12; -- tera
PeA : constant Electric_Current := 1.0E+15; -- peta
EA : constant Electric_Current := 1.0E+18; -- exa
ZeA : constant Electric_Current := 1.0E+21; -- zetta
YoA : constant Electric_Current := 1.0E+24; -- yotta
-- SI prefixes for Kelvin
yK : constant Thermodynamic_Temperature := 1.0E-24; -- yocto
zK : constant Thermodynamic_Temperature := 1.0E-21; -- zepto
aK : constant Thermodynamic_Temperature := 1.0E-18; -- atto
fK : constant Thermodynamic_Temperature := 1.0E-15; -- femto
pK : constant Thermodynamic_Temperature := 1.0E-12; -- pico
nK : constant Thermodynamic_Temperature := 1.0E-09; -- nano
uK : constant Thermodynamic_Temperature := 1.0E-06; -- micro (u)
mK : constant Thermodynamic_Temperature := 1.0E-03; -- milli
cK : constant Thermodynamic_Temperature := 1.0E-02; -- centi
dK : constant Thermodynamic_Temperature := 1.0E-01; -- deci
daK : constant Thermodynamic_Temperature := 1.0E+01; -- deka
hK : constant Thermodynamic_Temperature := 1.0E+02; -- hecto
kK : constant Thermodynamic_Temperature := 1.0E+03; -- kilo
MeK : constant Thermodynamic_Temperature := 1.0E+06; -- mega
GK : constant Thermodynamic_Temperature := 1.0E+09; -- giga
TK : constant Thermodynamic_Temperature := 1.0E+12; -- tera
PeK : constant Thermodynamic_Temperature := 1.0E+15; -- peta
EK : constant Thermodynamic_Temperature := 1.0E+18; -- exa
ZeK : constant Thermodynamic_Temperature := 1.0E+21; -- zetta
YoK : constant Thermodynamic_Temperature := 1.0E+24; -- yotta
-- SI prefixes for Mole
ymol : constant Amount_Of_Substance := 1.0E-24; -- yocto
zmol : constant Amount_Of_Substance := 1.0E-21; -- zepto
amol : constant Amount_Of_Substance := 1.0E-18; -- atto
fmol : constant Amount_Of_Substance := 1.0E-15; -- femto
pmol : constant Amount_Of_Substance := 1.0E-12; -- pico
nmol : constant Amount_Of_Substance := 1.0E-09; -- nano
umol : constant Amount_Of_Substance := 1.0E-06; -- micro (u)
mmol : constant Amount_Of_Substance := 1.0E-03; -- milli
cmol : constant Amount_Of_Substance := 1.0E-02; -- centi
dmol : constant Amount_Of_Substance := 1.0E-01; -- deci
damol : constant Amount_Of_Substance := 1.0E+01; -- deka
hmol : constant Amount_Of_Substance := 1.0E+02; -- hecto
kmol : constant Amount_Of_Substance := 1.0E+03; -- kilo
Memol : constant Amount_Of_Substance := 1.0E+06; -- mega
Gmol : constant Amount_Of_Substance := 1.0E+09; -- giga
Tmol : constant Amount_Of_Substance := 1.0E+12; -- tera
Pemol : constant Amount_Of_Substance := 1.0E+15; -- peta
Emol : constant Amount_Of_Substance := 1.0E+18; -- exa
Zemol : constant Amount_Of_Substance := 1.0E+21; -- zetta
Yomol : constant Amount_Of_Substance := 1.0E+24; -- yotta
-- SI prefixes for Candela
ycd : constant Luminous_Intensity := 1.0E-24; -- yocto
zcd : constant Luminous_Intensity := 1.0E-21; -- zepto
acd : constant Luminous_Intensity := 1.0E-18; -- atto
fcd : constant Luminous_Intensity := 1.0E-15; -- femto
pcd : constant Luminous_Intensity := 1.0E-12; -- pico
ncd : constant Luminous_Intensity := 1.0E-09; -- nano
ucd : constant Luminous_Intensity := 1.0E-06; -- micro (u)
mcd : constant Luminous_Intensity := 1.0E-03; -- milli
ccd : constant Luminous_Intensity := 1.0E-02; -- centi
dcd : constant Luminous_Intensity := 1.0E-01; -- deci
dacd : constant Luminous_Intensity := 1.0E+01; -- deka
hcd : constant Luminous_Intensity := 1.0E+02; -- hecto
kcd : constant Luminous_Intensity := 1.0E+03; -- kilo
Mecd : constant Luminous_Intensity := 1.0E+06; -- mega
Gcd : constant Luminous_Intensity := 1.0E+09; -- giga
Tcd : constant Luminous_Intensity := 1.0E+12; -- tera
Pecd : constant Luminous_Intensity := 1.0E+15; -- peta
Ecd : constant Luminous_Intensity := 1.0E+18; -- exa
Zecd : constant Luminous_Intensity := 1.0E+21; -- zetta
Yocd : constant Luminous_Intensity := 1.0E+24; -- yotta
pragma Warnings (On);
end System.Dim.Mks.Other_Prefixes;
new System.Dim.Mks.Generic_Other_Prefixes;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment