comp.lang.ada
 help / color / mirror / Atom feed
* Problem using Ada.Text_IO.Modular_IO
@ 2008-07-09 16:52 jujosei
  2008-07-09 19:03 ` Anh Vo
                   ` (2 more replies)
  0 siblings, 3 replies; 27+ messages in thread
From: jujosei @ 2008-07-09 16:52 UTC (permalink / raw)


Dear All,

I'm tying to print variables of a defined modular type to the standard
io and a file.
The type I'm working with is: type Unsigned is mod 2**64;

Therefore I define a modular_io package to do this:
package mio is new ada.text_io.modular_io(usigned);

However, when compile my little test program (using gnatmake -gnato),
the compiler tells me that a "Constraint Error" will be raised at
runtime. So I tried it with only 63 bit (mod 2**63), which works fine
with the GNAT 4.3.1 (20080420) on a 32bit Ubuntu-Linux machine.

----------- test program -----------
with ada.text_io; use ada.text_io;
procedure test is
	type Unsigned is mod 2**64;
	package M_IO is new Ada.Text_IO.Modular_IO (Unsigned);
	u : Unsigned := -1;
begin
	m_io.put(Item =>  u, Width =>  20, Base  => 16);
end;
-----------------------------------------

I guess that this is a bug. However, what can I do instead of this, to
get 64 bit words printed as hex, octal and binary?

Thanks in advance!
Cheers
Julian Seifert



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

end of thread, other threads:[~2008-07-17 16:33 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-09 16:52 Problem using Ada.Text_IO.Modular_IO jujosei
2008-07-09 19:03 ` Anh Vo
2008-07-09 19:22   ` Adam Beneschan
2008-07-09 21:50 ` Adam Beneschan
2008-07-10 15:00   ` jujosei
2008-07-10  0:48 ` anon
2008-07-10  1:52   ` Adam Beneschan
2008-07-10  7:25     ` anon
2008-07-10 14:59       ` Adam Beneschan
2008-07-11  0:34         ` anon
2008-07-11  9:49           ` Georg Bauhaus
2008-07-11 10:05             ` christoph.grein
2008-07-11 13:21               ` John McCormick
2008-07-11 12:16             ` anon
2008-07-11 13:26               ` petter_fryklund
2008-07-11 21:10                 ` anon
2008-07-12 10:06                   ` Georg Bauhaus
2008-07-13  0:51                     ` anon
2008-07-13 16:03                     ` Georg Bauhaus
2008-07-14  2:03                       ` anon
2008-07-14 13:12                         ` Georg Bauhaus
2008-07-16  6:16                           ` micronian2
2008-07-16  7:47                             ` anon
2008-07-17 16:33                               ` micronian2
2008-07-14 16:34                       ` micronian2
2008-07-14 17:26                         ` Georg Bauhaus
2008-07-16  6:28                           ` micronian2

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox