This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
ada/8925: Floating point code gives incorrect results
- From: sjs at essex dot ac dot uk
- To: gcc-gnats at gcc dot gnu dot org
- Date: 13 Dec 2002 13:15:02 -0000
- Subject: ada/8925: Floating point code gives incorrect results
- Reply-to: sjs at essex dot ac dot uk
>Number: 8925
>Category: ada
>Synopsis: Floating point code gives incorrect results
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Fri Dec 13 05:16:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Steve Sangwine, University of Essex, UK
>Release: gcc 3.2
>Organization:
>Environment:
Windows 2000
MinGW 2.0.0-3
>Description:
The code attached contains a test program and part of a library of code which works correctly with Gnat 3.15p and
previous versions of Gnat. When compiled with gcc 3.2 this
code gives incorrect numerical results (integer values output are never changed from -infinity, as they should be).
>How-To-Repeat:
Compile the main program rgb_conversions_test.adb. NB I have
reported a fault with gnatchop, which on my system fails to chop the source code file which I have attached. Run the program rgb_conversions_test and at the prompts enter 180.0 for phase, 1.0 for saturation and 0.5 for intensity. The output that I get is shown in the file incorrect.txt. When compiled with Gnat 3.15p the same code gives the results shown in the file correct.txt.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="incorrect.txt"
Content-Disposition: inline; filename="incorrect.txt"
D:\Ada\Creake\Test>rgb_conversion_test
Enter phase: 180.0
Enter saturation: 1.0
Enter intensity: 0.5
Invalid_HSI_Coordinate raised
Raw values: 0-2147483648-2147483648
Enter phase: ^C
D:\Ada\Creake\Test>