From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d26c6b989a75af31 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-10-13 17:24:37 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: zhenggen@public1.ptt.js.cn (zhenggen) Newsgroups: comp.lang.ada Subject: Re: Problems with gcc, gnat and RedHat 8 Date: 13 Oct 2002 17:24:36 -0700 Organization: http://groups.google.com/ Message-ID: <7bc8e94c.0210131624.28e1bb6@posting.google.com> References: <7bc8e94c.0210110723.1f5509b9@posting.google.com> NNTP-Posting-Host: 202.102.89.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1034555076 25321 127.0.0.1 (14 Oct 2002 00:24:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 14 Oct 2002 00:24:36 GMT Xref: archiver1.google.com comp.lang.ada:29757 Date: 2002-10-14T00:24:36+00:00 List-Id: > gcc bug report database. One can work around it by importing these > > functions from C math library. > > How ? > > reinert A demo program: with Ada.Text_Io; use Ada.Text_Io; with Interfaces.C; use Interfaces.C; with Ada.Numerics.Long_Long_Elementary_Functions; with Ada.Numerics.Elementary_Functions; procedure Sin_ada is -- pragma Linker_Options("-L/usr/lib/"); package Llfef renames Ada.Numerics.Long_Long_Elementary_Functions; package Fef renames Ada.Numerics.Elementary_Functions; pragma Linker_Options("-lm"); function Sinl(X:Long_Double) return Long_Double; function Cosl(X:Long_Double) return Long_Double; pragma Import(C,Sinl,"sinl"); pragma Import(C,Cosl,"cosl"); X,Y:Long_Double:=0.1; Xllf,Yllfsin,yllfcos: Long_Long_Float:=0.0; Xf,Yfsin,Yfcos:Float:=0.0; begin Y:=Sinl(X); Put_Line("sinl("&Long_Double'Image(X)&")="&Long_Double'Image(Y)); Y:=Cosl(X); Put_Line("cosl("&Long_Double'Image(X)&")="&Long_Double'Image(Y)); Xllf:=0.1; Yllfsin:=Llfef.Sin(Xllf); Put_Line("yllfsin is NaN? "&Boolean'Image(not (Yllfsin=Yllfsin))); Put_Line("sin("&long_long_float'Image(Xllf)&")="&long_long_float'Image(Yllfsin)); Yllfcos:=Llfef.Cos(Xllf); Put_Line("cos("&long_long_float'Image(Xllf)&")="&long_long_float'Image(Yllfcos)); Put_Line("-------------"); Xf:=0.1; Yfsin:=fef.Sin(Xf); Yfcos:=Fef.Cos(Xf); Put_Line("-------------"); Put_Line("yfsin is NaN? "&Boolean'Image(not (Yfsin=Yfsin))); Put_Line("sin("&float'Image(Xf)&")="&float'Image(Yfsin)); Put_Line("cos("&float'Image(Xf)&")="&float'Image(Yfcos)); end;