public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/29462]  New: Sign ignored on fixed point multiplication
@ 2006-10-13 17:43 dewi dot daniels at silver-software dot com
  2006-10-13 21:34 ` [Bug ada/29462] " laurent at guerby dot net
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: dewi dot daniels at silver-software dot com @ 2006-10-13 17:43 UTC (permalink / raw)
  To: gcc-bugs

The sign seems to be ignored when multiplying a named number with a fixed point
value.  Converting the named number to a fixed point type seems to work around
the problem.  See the example below:

with Ada.Text_IO;
procedure Test
is
   type T is delta 0.1 range -1.0 .. 1.0;
   X : constant := -1.0;
   Y : T;
   package T_IO is new Ada.Text_IO.Fixed_IO (T);
begin
   Ada.Text_IO.Put ("X = "); T_IO.Put (X); Ada.Text_IO.New_Line;
   Y := -1.0;
   Ada.Text_IO.Put ("Y = "); T_IO.Put (Y); Ada.Text_IO.New_Line;
   Ada.Text_IO.Put ("X * Y = "); T_IO.Put (X * Y); Ada.Text_IO.New_Line;
   Ada.Text_IO.Put ("T (X) * Y = "); T_IO.Put (T (X) * Y);
Ada.Text_IO.New_Line;
end Test;


-- 
           Summary: Sign ignored on fixed point multiplication
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dewi dot daniels at silver-software dot com


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/29462] Sign ignored on fixed point multiplication
  2006-10-13 17:43 [Bug ada/29462] New: Sign ignored on fixed point multiplication dewi dot daniels at silver-software dot com
@ 2006-10-13 21:34 ` laurent at guerby dot net
  2007-05-02 12:21 ` charlet at gcc dot gnu dot org
  2007-05-02 14:48 ` dewi dot daniels at silver-software dot com
  2 siblings, 0 replies; 4+ messages in thread
From: laurent at guerby dot net @ 2006-10-13 21:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from laurent at guerby dot net  2006-10-13 21:34 -------
Confirmed with gcc version 4.2.0 20060922 (experimental)

$ gnatmake test
$ ./test
X = -1.0
Y = -1.0
X * Y = -1.0
T (X) * Y =  1.0


-- 

laurent at guerby dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |wrong-code
   Last reconfirmed|0000-00-00 00:00:00         |2006-10-13 21:34:24
               date|                            |


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/29462] Sign ignored on fixed point multiplication
  2006-10-13 17:43 [Bug ada/29462] New: Sign ignored on fixed point multiplication dewi dot daniels at silver-software dot com
  2006-10-13 21:34 ` [Bug ada/29462] " laurent at guerby dot net
@ 2007-05-02 12:21 ` charlet at gcc dot gnu dot org
  2007-05-02 14:48 ` dewi dot daniels at silver-software dot com
  2 siblings, 0 replies; 4+ messages in thread
From: charlet at gcc dot gnu dot org @ 2007-05-02 12:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from charlet at gcc dot gnu dot org  2007-05-02 13:20 -------
I get the following on trunk, which I assume is the expected output:

$ ./test
X = -1.0
Y = -1.0
X * Y =  1.0
T (X) * Y =  1.0


-- 

charlet at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug ada/29462] Sign ignored on fixed point multiplication
  2006-10-13 17:43 [Bug ada/29462] New: Sign ignored on fixed point multiplication dewi dot daniels at silver-software dot com
  2006-10-13 21:34 ` [Bug ada/29462] " laurent at guerby dot net
  2007-05-02 12:21 ` charlet at gcc dot gnu dot org
@ 2007-05-02 14:48 ` dewi dot daniels at silver-software dot com
  2 siblings, 0 replies; 4+ messages in thread
From: dewi dot daniels at silver-software dot com @ 2007-05-02 14:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from dewi dot daniels at silver-software dot com  2007-05-02 15:48 -------
Subject: RE:  Sign ignored on fixed point multiplication

Yes, that output looks correct to me :)

> -----Original Message-----
> From: charlet at gcc dot gnu dot org 
> [mailto:gcc-bugzilla@gcc.gnu.org] 
> Sent: 02 May 2007 13:21
> To: dewi.daniels@silver-software.com
> Subject: [Bug ada/29462] Sign ignored on fixed point multiplication
> 
> 
> 
> 
> ------- Comment #2 from charlet at gcc dot gnu dot org  
> 2007-05-02 13:20 ------- I get the following on trunk, which 
> I assume is the expected output:
> 
> $ ./test
> X = -1.0
> Y = -1.0
> X * Y =  1.0
> T (X) * Y =  1.0
> 
> 
> -- 
> 
> charlet at gcc dot gnu dot org changed:
> 
>            What    |Removed                     |Added
> --------------------------------------------------------------
> --------------
>              Status|NEW                         |RESOLVED
>          Resolution|                            |FIXED
>    Target Milestone|---                         |4.3.0
> 
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29462
> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 


-- 


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-05-02 14:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-13 17:43 [Bug ada/29462] New: Sign ignored on fixed point multiplication dewi dot daniels at silver-software dot com
2006-10-13 21:34 ` [Bug ada/29462] " laurent at guerby dot net
2007-05-02 12:21 ` charlet at gcc dot gnu dot org
2007-05-02 14:48 ` dewi dot daniels at silver-software dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).