From: William Paul Berriss <W.P.Berriss@reading.ac.uk>
Subject: GNAT for loop can't count!
Date: 1997/07/28
Date: 1997-07-28T00:00:00+00:00 [thread overview]
Message-ID: <33DCBE03.27E8@reading.ac.uk> (raw)
Hi
I use GNAT Ada95 compiler v3.07 on a Sun SPARC 5 runnig Solaris 2.5.
I have very simple for loop that should count upwards from 118 to 129
but it counts 118, ..., 126, 127, -128, -127 (i.e. changes to
Negative after 127)
Here is the loop:
for P in Pixel(Firstp)..Pixel(Lastp) loop
Ada.Integer_Text_IO.Put(Integer(P));
Ada.Text_IO.New_line;
end loop;
Where Pixel is Integer range 0..255
and
Firstp and Lastp at this point are 118 and 129 respectively.
Both of type Pixel.
Very weird!
Any advice or helpful ideas most welcome indeed!!!!!!
Will Berriss
------------
--
W P Berriss E-mail: W.P.Berriss@reading.ac.uk
Department of Engineering
The University of Reading
Whiteknights
Reading Tel: 0118 987 5123
Berkshire (+44 118 987 5123 outside UK)
RG6 6AY
England Fax: 0118 931 3327
World Wide Web Home Page:
http://www.elec.rdg.ac.uk/people/postgrads/will.html
next reply other threads:[~1997-07-28 0:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-07-28 0:00 William Paul Berriss [this message]
1997-07-28 0:00 ` GNAT for loop can't count! Robert Dewar
1997-07-28 0:00 ` Matthew Heaney
1997-07-29 0:00 ` Anonymous
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox