comp.lang.ada
 help / color / mirror / Atom feed
From: "Nick Roberts" <Nick.Roberts@dial.pipex.com>
Subject: Re: ada help please
Date: 1999/02/01
Date: 1999-02-01T00:00:00+00:00	[thread overview]
Message-ID: <795rd6$16t$1@plug.news.pipex.net> (raw)
In-Reply-To: 36ab9c3f.2963059@news.ptd.net

At the risk of doing your homework for you, declare

   subtype Digit is Character range '0'..'9';

   DigVal: constant array (Digit) of Integer :=
      (0,1,2,3,4,5,6,7,8,9);

Now you can add up by having something like

   DigSum := DigVal(A(i)) + DigVal(B(i)) + Carry;

in your loop. Good luck!

-------------------------------------------
Nick Roberts
-------------------------------------------







      parent reply	other threads:[~1999-02-01  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <36ab9c3f.2963059@news.ptd.net>
1999-01-25  0:00 ` ada help please Anthony E. Glover
1999-01-26  0:00 ` Tom Moran
1999-02-01  0:00   ` Robert I. Eachus
1999-02-01  0:00 ` Nick Roberts [this message]
replies disabled

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