From: Laurent.Guerby@enst-bretagne.fr (Laurent Guerby)
Subject: Re: HELP:Declaration in ADA?!!
Date: 1996/03/25
Date: 1996-03-25T00:00:00+00:00 [thread overview]
Message-ID: <4xybopb27y.fsf@leibniz.enst-bretagne.fr> (raw)
In-Reply-To: 4j65rr$fqg@soleil.uvsq.fr
Tuyet-Tram DANG-NGOC writes
:
: Hi there,
:
: I have a stupid question to ask.
: DOES SOMEONE KNOW HOW TO DECLARE LONG_INTEGER IN ADA?
with Text_IO;
procedure Very_Long is
The_Bigger_Absolute_Number_I_Want : constant := 999_999_999_999_999;
type My_Very_Long_Integer is range
-The_Bigger_Absolute_Number_I_Want ..
+The_Bigger_Absolute_Number_I_Want;
X : My_Very_Long_Integer := The_Bigger_Absolute_Number_I_Want / 2;
begin
Text_IO.Put_Line (My_Very_Long_Integer'Image (X));
end Very_Long;
With GNAT 3.01 on Solaris (it will also work in Ada 83) :
bash$ gnatmake very_long
gcc -c very_long.adb
gnatbind very_long.ali
gnatbl very_long.ali -linkonly
bash$ ./very_long
499999999999999
bash$
: All the books I've read here does not answer this metaphysical
: question, they just take it as if everyone should know how to declare
: it. In a wonderful book, I've seen how to declare LONG_REAL by typing:
: type LONG_REAL is DIGIT 14;
: But how to do it for LONG_INTEGER?
It must be on your book, near the page number 1, how to declare a
constrained integer type.
: Can someone answers me pleeeeaaaase, i've a big and horrible project
: to finish
^^^^^^^^^^^^^^^^
: for very soon.
If you don't know the basic of Ada (yes type X is range A .. B is
one of Ada's basis), it's hard to achieve a big project in another way
than horrible. Also true for any language X.
: Thank you very much for having paid attention to my question, and thank you
: very very much if you reply.
: TRAM
: --
: Tuyet Tram DANG NGOC
: Licence d'informatique
: Universite de Versailles
: dangngoc@ens-info.uvsq.fr
: http://www.ens-info.uvsq.fr:8000/public/dangngoc/index.html
--
-- Laurent Guerby, student at Telecom Bretagne (France), Team Ada
-- "Use the Source, Luke. The Source will be with you, always (GPL)"
-- http://www-eleves.enst-bretagne.fr/~guerby/ (GATO Project)
-- Try GNAT, the GNU Ada 95 compiler (ftp://cs.nyu.edu/pub/gnat)
next prev parent reply other threads:[~1996-03-25 0:00 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-03-25 0:00 HELP:Declaration in ADA?!! Tuyet-Tram DANG-NGOC
1996-03-25 0:00 ` Robert Dewar
1996-03-25 0:00 ` Laurent Guerby [this message]
1996-03-28 0:00 ` Ken Devlin
1996-04-08 0:00 ` Ken Devlin
1996-04-09 0:00 ` Walter B. Hollman Sr.
1996-04-09 0:00 ` Martin C. Martin
1996-04-09 0:00 ` Keith Thompson
1996-04-18 0:00 ` Daryl Siddon
1996-04-22 0:00 ` John English
1996-04-24 0:00 ` Robert Dewar
-- strict thread matches above, loose matches on Subject: below --
1996-03-28 0:00 Scott B. Crawford 0131-314-8253
1996-03-25 0:00 tmoran
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox