This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/11391] New: Invalid return values from math libraries


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11391

           Summary: Invalid return values from math libraries
           Product: gcc
           Version: 3.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: drudnick at dcscorp dot com
                CC: gcc-bugs at gcc dot gnu dot org

Versions: GCC/Gnat 3.2 and GCC/Gnat 3.2.2
Platform: Windows 2000(MinGW) and Linux(Redhat 9.0, Mandrake 9.1)
Problem: Using the ada.numerics.generic_elementary_functions incorrect values 
returned from operations such as Sin and Cos

Code:
------------------------------------------------------
with ada.text_io;
with ada.numerics.generic_elementary_functions;

procedure Test_322 is

   -- Problem 1 stuff
   subtype Raw is long_float;
   package Math is new ada.numerics.generic_elementary_functions(Raw);

   Value  : Raw := 0.523;
   Result : Raw;
begin
   -- Problem 1
   ada.text_io.new_line;
   ada.text_io.put_line("GNAT 3.2.x (Not ACT GNAT 5.0) problem 1");
   ada.text_io.put_line("   Incorrect math library operations");
   ada.text_io.put("Sin(" & Raw'image(Value) & ") => ");

   -- Perform math library call
   Result := Math.Sin(Value);

   -- Output result from operation
   ada.text_io.put_line(Raw'image(Result));
end Test_322;
------------------------------------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]