home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adav313.zip / gnat-3_13p-os2-bin-20010916.zip / emx / gnatlib / s-vaflop.adb < prev    next >
Text File  |  2000-07-19  |  9KB  |  422 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                         GNAT RUN-TIME COMPONENTS                         --
  4. --                                                                          --
  5. --           S Y S T E M . V A X _ F L O A T _ O P E R A T I O N S          --
  6. --                                                                          --
  7. --                                 B o d y                                  --
  8. --                                                                          --
  9. --                            $Revision: 1.19 $
  10. --                                                                          --
  11. --          Copyright (C) 1997-2000 Free Software Foundation, Inc.          --
  12. --                                                                          --
  13. -- GNAT is free software;  you can  redistribute it  and/or modify it under --
  14. -- terms of the  GNU General Public License as published  by the Free Soft- --
  15. -- ware  Foundation;  either version 2,  or (at your option) any later ver- --
  16. -- sion.  GNAT is distributed in the hope that it will be useful, but WITH- --
  17. -- OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY --
  18. -- or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License --
  19. -- for  more details.  You should have  received  a copy of the GNU General --
  20. -- Public License  distributed with GNAT;  see file COPYING.  If not, write --
  21. -- to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, --
  22. -- MA 02111-1307, USA.                                                      --
  23. --                                                                          --
  24. -- As a special exception,  if other files  instantiate  generics from this --
  25. -- unit, or you link  this unit with other files  to produce an executable, --
  26. -- this  unit  does not  by itself cause  the resulting  executable  to  be --
  27. -- covered  by the  GNU  General  Public  License.  This exception does not --
  28. -- however invalidate  any other reasons why  the executable file  might be --
  29. -- covered by the  GNU Public License.                                      --
  30. --                                                                          --
  31. -- GNAT was originally developed  by the GNAT team at  New York University. --
  32. -- It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). --
  33. --                                                                          --
  34. ------------------------------------------------------------------------------
  35.  
  36. --  This is a dummy body for use on non-Alpha systems so that the library
  37. --  can compile. This dummy version uses ordinary conversions and other
  38. --  arithmetic operations. it is used only for testing purposes in the
  39. --  case where the -gnatdm switch is used to force testing of VMS features
  40. --  on non-VMS systems.
  41.  
  42. with System.IO; use System.IO;
  43.  
  44. package body System.Vax_Float_Operations is
  45.  
  46.    ------------
  47.    -- D_To_G --
  48.    ------------
  49.  
  50.    function D_To_G (X : D) return G is
  51.    begin
  52.       return G (X);
  53.    end D_To_G;
  54.  
  55.    ------------
  56.    -- F_To_G --
  57.    ------------
  58.  
  59.    function F_To_G (X : F) return G is
  60.    begin
  61.       return G (X);
  62.    end F_To_G;
  63.  
  64.    ------------
  65.    -- F_To_Q --
  66.    ------------
  67.  
  68.    function F_To_Q (X : F) return Q is
  69.    begin
  70.       return Q (X);
  71.    end F_To_Q;
  72.  
  73.    ------------
  74.    -- F_To_S --
  75.    ------------
  76.  
  77.    function F_To_S (X : F) return S is
  78.    begin
  79.       return S (X);
  80.    end F_To_S;
  81.  
  82.    ------------
  83.    -- G_To_D --
  84.    ------------
  85.  
  86.    function G_To_D (X : G) return D is
  87.    begin
  88.       return D (X);
  89.    end G_To_D;
  90.  
  91.    ------------
  92.    -- G_To_F --
  93.    ------------
  94.  
  95.    function G_To_F (X : G) return F is
  96.    begin
  97.       return F (X);
  98.    end G_To_F;
  99.  
  100.    ------------
  101.    -- G_To_Q --
  102.    ------------
  103.  
  104.    function G_To_Q (X : G) return Q is
  105.    begin
  106.       return Q (X);
  107.    end G_To_Q;
  108.  
  109.    ------------
  110.    -- G_To_T --
  111.    ------------
  112.  
  113.    function G_To_T (X : G) return T is
  114.    begin
  115.       return T (X);
  116.    end G_To_T;
  117.  
  118.    ------------
  119.    -- Q_To_F --
  120.    ------------
  121.  
  122.    function Q_To_F (X : Q) return F is
  123.    begin
  124.       return F (X);
  125.    end Q_To_F;
  126.  
  127.    ------------
  128.    -- Q_To_G --
  129.    ------------
  130.  
  131.    function Q_To_G (X : Q) return G is
  132.    begin
  133.       return G (X);
  134.    end Q_To_G;
  135.  
  136.    ------------
  137.    -- S_To_F --
  138.    ------------
  139.  
  140.    function S_To_F (X : S) return F is
  141.    begin
  142.       return F (X);
  143.    end S_To_F;
  144.  
  145.    ------------
  146.    -- T_To_D --
  147.    ------------
  148.  
  149.    function T_To_D (X : T) return D is
  150.    begin
  151.       return G_To_D (T_To_G (X));
  152.    end T_To_D;
  153.  
  154.    ------------
  155.    -- T_To_G --
  156.    ------------
  157.  
  158.    function T_To_G (X : T) return G is
  159.    begin
  160.       return G (X);
  161.    end T_To_G;
  162.  
  163.    -----------
  164.    -- Abs_F --
  165.    -----------
  166.  
  167.    function Abs_F (X : F) return F is
  168.    begin
  169.       return abs X;
  170.    end Abs_F;
  171.  
  172.    -----------
  173.    -- Abs_G --
  174.    -----------
  175.  
  176.    function Abs_G (X : G) return G is
  177.    begin
  178.       return abs X;
  179.    end Abs_G;
  180.  
  181.    -----------
  182.    -- Add_F --
  183.    -----------
  184.  
  185.    function Add_F (X, Y : F) return F is
  186.    begin
  187.       return X + Y;
  188.    end Add_F;
  189.  
  190.    -----------
  191.    -- Add_G --
  192.    -----------
  193.  
  194.    function Add_G (X, Y : G) return G is
  195.    begin
  196.       return X + Y;
  197.    end Add_G;
  198.  
  199.    --------------------
  200.    -- Debug_Output_D --
  201.    --------------------
  202.  
  203.    procedure Debug_Output_D (Arg : D) is
  204.    begin
  205.       Put (D'Image (Arg));
  206.    end Debug_Output_D;
  207.  
  208.    --------------------
  209.    -- Debug_Output_F --
  210.    --------------------
  211.  
  212.    procedure Debug_Output_F (Arg : F) is
  213.    begin
  214.       Put (F'Image (Arg));
  215.    end Debug_Output_F;
  216.  
  217.    --------------------
  218.    -- Debug_Output_G --
  219.    --------------------
  220.  
  221.    procedure Debug_Output_G (Arg : G) is
  222.    begin
  223.       Put (G'Image (Arg));
  224.    end Debug_Output_G;
  225.  
  226.    --------------------
  227.    -- Debug_String_D --
  228.    --------------------
  229.  
  230.    Debug_String_Buffer : String (1 .. 32);
  231.    --  Buffer used by all Debug_String_x routines for returning result
  232.  
  233.    function Debug_String_D (Arg : D) return System.Address is
  234.       Image_String : constant String := D'Image (Arg) & ASCII.NUL;
  235.       Image_Size   : constant Integer := Image_String'Length;
  236.  
  237.    begin
  238.       Debug_String_Buffer (1 .. Image_Size) := Image_String;
  239.       return Debug_String_Buffer (1)'Address;
  240.    end Debug_String_D;
  241.  
  242.    --------------------
  243.    -- Debug_String_F --
  244.    --------------------
  245.  
  246.    function Debug_String_F (Arg : F) return System.Address is
  247.       Image_String : constant String := F'Image (Arg) & ASCII.NUL;
  248.       Image_Size   : constant Integer := Image_String'Length;
  249.  
  250.    begin
  251.       Debug_String_Buffer (1 .. Image_Size) := Image_String;
  252.       return Debug_String_Buffer (1)'Address;
  253.    end Debug_String_F;
  254.  
  255.    --------------------
  256.    -- Debug_String_G --
  257.    --------------------
  258.  
  259.    function Debug_String_G (Arg : G) return System.Address is
  260.       Image_String : constant String := G'Image (Arg) & ASCII.NUL;
  261.       Image_Size   : constant Integer := Image_String'Length;
  262.  
  263.    begin
  264.       Debug_String_Buffer (1 .. Image_Size) := Image_String;
  265.       return Debug_String_Buffer (1)'Address;
  266.    end Debug_String_G;
  267.  
  268.    -----------
  269.    -- Div_F --
  270.    -----------
  271.  
  272.    function Div_F (X, Y : F) return F is
  273.    begin
  274.       return X / Y;
  275.    end Div_F;
  276.  
  277.    -----------
  278.    -- Div_G --
  279.    -----------
  280.  
  281.    function Div_G (X, Y : G) return G is
  282.    begin
  283.       return X / Y;
  284.    end Div_G;
  285.  
  286.    ----------
  287.    -- Eq_F --
  288.    ----------
  289.  
  290.    function Eq_F (X, Y : F) return Boolean is
  291.    begin
  292.       return X = Y;
  293.    end Eq_F;
  294.  
  295.    ----------
  296.    -- Eq_G --
  297.    ----------
  298.  
  299.    function Eq_G (X, Y : G) return Boolean is
  300.    begin
  301.       return X = Y;
  302.    end Eq_G;
  303.  
  304.    ----------
  305.    -- Le_F --
  306.    ----------
  307.  
  308.    function Le_F (X, Y : F) return Boolean is
  309.    begin
  310.       return X <= Y;
  311.    end Le_F;
  312.  
  313.    ----------
  314.    -- Le_G --
  315.    ----------
  316.  
  317.    function Le_G (X, Y : G) return Boolean is
  318.    begin
  319.       return X <= Y;
  320.    end Le_G;
  321.  
  322.    ----------
  323.    -- Lt_F --
  324.    ----------
  325.  
  326.    function Lt_F (X, Y : F) return Boolean is
  327.    begin
  328.       return X < Y;
  329.    end Lt_F;
  330.  
  331.    ----------
  332.    -- Lt_G --
  333.    ----------
  334.  
  335.    function Lt_G (X, Y : G) return Boolean is
  336.    begin
  337.       return X < Y;
  338.    end Lt_G;
  339.  
  340.    -----------
  341.    -- Mul_F --
  342.    -----------
  343.  
  344.    function Mul_F (X, Y : F) return F is
  345.    begin
  346.       return X * Y;
  347.    end Mul_F;
  348.  
  349.    -----------
  350.    -- Mul_G --
  351.    -----------
  352.  
  353.    function Mul_G (X, Y : G) return G is
  354.    begin
  355.       return X * Y;
  356.    end Mul_G;
  357.  
  358.    -----------
  359.    -- Neg_F --
  360.    -----------
  361.  
  362.    function Neg_F (X : F) return F is
  363.    begin
  364.       return -X;
  365.    end Neg_F;
  366.  
  367.    -----------
  368.    -- Neg_G --
  369.    -----------
  370.  
  371.    function Neg_G (X : G) return G is
  372.    begin
  373.       return -X;
  374.    end Neg_G;
  375.  
  376.    --------
  377.    -- pd --
  378.    --------
  379.  
  380.    procedure pd (Arg : D) is
  381.    begin
  382.       Put_Line (D'Image (Arg));
  383.    end pd;
  384.  
  385.    --------
  386.    -- pf --
  387.    --------
  388.  
  389.    procedure pf (Arg : F) is
  390.    begin
  391.       Put_Line (F'Image (Arg));
  392.    end pf;
  393.  
  394.    --------
  395.    -- pg --
  396.    --------
  397.  
  398.    procedure pg (Arg : G) is
  399.    begin
  400.       Put_Line (G'Image (Arg));
  401.    end pg;
  402.  
  403.    -----------
  404.    -- Sub_F --
  405.    -----------
  406.  
  407.    function Sub_F (X, Y : F) return F is
  408.    begin
  409.       return X - Y;
  410.    end Sub_F;
  411.  
  412.    -----------
  413.    -- Sub_G --
  414.    -----------
  415.  
  416.    function Sub_G (X, Y : G) return G is
  417.    begin
  418.       return X - Y;
  419.    end Sub_G;
  420.  
  421. end System.Vax_Float_Operations;
  422.