Description of problem: The functions in Ada.Numerics.Generic_Elementary_Functions return bad results, eg. sin PI/2 = 1.68353553615965E-4932. The actual value seems to depend on the circumstances in which the code was compiled - on a different machine the value was 1.57079632679490E+15 (ie. the input value but multiplied by 1E+15) Version-Release number of selected component (if applicable): gcc-gnat-3.2-7 GNATMAKE 3.2 20020903 (3.2-7) How reproducible: -- Start simple Ada program with Ada.Numerics.Generic_Elementary_Functions; with Ada.Text_IO; procedure MathProblem is package MyMath is new Ada.Numerics.Generic_Elementary_Functions(long_float); x, y : long_float := 0.0; begin x := Ada.Numerics.Pi / 2.0; Ada.Text_IO.Put_Line("x = " & long_float'Image(x)); y := MyMath.Sin(x); Ada.Text_IO.Put_Line("sin(x) = " & long_float'Image(y)); end MathProblem; -- End simple Ada program Steps to Reproduce: 1. Save above code in mathproblem.adb 2. Run gnatmake -v mathproblem 3. Run ./mathproblem Actual results: ./mathproblem x = 1.57079632679490E+00 sin(x) = 1.68353553615965E-4932 Expected results: sin(x) = 1.00000000000000E+00 (+/- some small delta obviously) Additional info: GNAT 3.2 on Solaris 8 prints sin(x) = 9.99999685041438E-01 GNAT 3.13p on RedHat 7.1 prints sin(x) = 9.99999999979986E-01 The GNAT 3.2 with RedHat 8.0 uses the "Machine Version" of package Ada.Numerics.Aux (a-numaux.ads) whereas GNAT 3.2 on Solaris and GNAT 3.13p from RedHat 7.1 use the "C Library Version".
With gcc 3.2.3-20, I see similar completely bogus results, but things appear to be fixed with gcc 3.3.2-1.