[BACK]Return to standard_floating_numbers.adb CVS log [TXT][DIR] Up to [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Numbers

File: [local] / OpenXM_contrib / PHC / Ada / Math_Lib / Numbers / standard_floating_numbers.adb (download)

Revision 1.1, Sun Oct 29 17:45:26 2000 UTC (23 years, 8 months ago) by maekawa
Branch point for: MAIN

Initial revision

package body standard_floating_numbers is

  function Create ( n : natural ) return single_float is
  begin
    return single_float(n);
  end Create;

  function Create ( n : natural ) return double_float is
  begin
    return double_float(n);
  end Create;

  function Equal ( a,b : single_float ) return boolean is
  begin
    return (a = b);
  end equal;

  function Equal ( a,b : double_float ) return boolean is
  begin
    return (a = b);
  end Equal;

  function AbsVal ( a : single_float ) return single_float is
  begin
    return ABS(a);
  end AbsVal;

  function AbsVal ( a : double_float ) return double_float is
  begin
    return ABS(a);
  end AbsVal;

  procedure Copy ( a : in single_float; b : in out single_float ) is
  begin
    b := a;
  end Copy;

  procedure Copy ( a : in double_float; b : in out double_float ) is
  begin
    b := a;
  end Copy;

  procedure Add ( a : in out single_float; b : in single_float ) is
  begin
    a := a + b;
  end Add;

  procedure Add ( a : in out double_float; b : in double_float ) is
  begin
    a := a + b;
  end Add;

  procedure Sub ( a : in out single_float; b : in single_float ) is
  begin
    a := a - b;
  end Sub;

  procedure Sub ( a : in out double_float; b : in double_float ) is
  begin
    a := a - b;
  end Sub;

  procedure Min  ( a : in out single_float ) is
  begin
    a := -a;
  end Min;

  procedure Min ( a : in out double_float ) is
  begin
    a := -a;
  end Min;

  procedure Mul ( a : in out single_float; b : in single_float ) is
  begin
    a := a*b;
  end Mul;

  procedure Mul ( a : in out double_float; b : in double_float ) is
  begin
    a := a*b;
  end Mul;

  procedure Div ( a : in out single_float; b : in single_float ) is
  begin
    a := a/b;
  end Div;

  procedure Div ( a : in out double_float; b : in double_float ) is
  begin
    a := a/b;
  end Div;

  procedure Clear ( a : in out single_float ) is
  begin
    null;
  end Clear;

  procedure Clear ( a : in out double_float ) is
  begin
    null;
  end Clear;

end Standard_Floating_Numbers;