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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,cf7bb651bfb9d65c,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-28 20:17:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: happysegfault@yahoo.com (Happy Segfault) Newsgroups: comp.lang.ada Subject: GNAT Ada.Numerics.Aux question Date: 28 Jul 2003 20:17:01 -0700 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 24.207.253.36 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1059448621 31787 127.0.0.1 (29 Jul 2003 03:17:01 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 29 Jul 2003 03:17:01 GMT Xref: archiver1.google.com comp.lang.ada:40920 Date: 2003-07-29T03:17:01+00:00 List-Id: Hi all! I'm trying out GtkAda 2.2.0 on my Red Hat 9 system using gcc 3.2.2, and the testgtk OpenGL demo crashes with a constraint error. I think I've tracked down the problem to a call to Ada.Numerics.Aux.Sin, which is a thin binding to the libm sin function. What could be going wrong here? Why isn't Sin (X) getting the expected value in the program below? Oddly, Sqrt (X) seems to work fine. -- -- test_sin.adb -- with Ada.Text_IO; with Ada.Numerics.Aux; procedure test_sin is X : Ada.Numerics.Aux.Double; begin X := Ada.Numerics.Aux.Double (2.0); X := Ada.Numerics.Aux.Sqrt (X); Ada.Text_IO.Put_Line (Ada.Numerics.Aux.Double'Image (X)); -- output is ' 1.41421356237309505E+00' which is expected X := Ada.Numerics.Aux.Double (30.0 * 3.14159 / 180.0); X := Ada.Numerics.Aux.Sin (X); -- use the pragma Import (C, Sin, "sin"); from Ada.Numerics.Aux Ada.Text_IO.Put_Line (Ada.Numerics.Aux.Double'Image (X)); -- output is '0.E+17' but 0.5 is the expected result Ada.Text_IO.Put_Line (Float'Image (Float (X))); -- raises constraint error end test_sin; Thanks! John