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

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).