comp.lang.ada
 help / color / mirror / Atom feed
* HELP:Declaration in ADA?!!
@ 1996-03-25  0:00 Tuyet-Tram DANG-NGOC
  1996-03-25  0:00 ` Robert Dewar
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Tuyet-Tram DANG-NGOC @ 1996-03-25  0:00 UTC (permalink / raw)


Hi there,

I have a stupid question to ask.
DOES SOMEONE KNOW HOW TO DECLARE LONG_INTEGER IN ADA?
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?
Can someone answers me pleeeeaaaase, i've a big and horrible project to finish
for very soon.

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





^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: HELP:Declaration in ADA?!!
@ 1996-03-28  0:00 Scott B. Crawford 0131-314-8253
  0 siblings, 0 replies; 13+ messages in thread
From: Scott B. Crawford 0131-314-8253 @ 1996-03-28  0:00 UTC (permalink / raw)


>DOES SOMEONE KNOW HOW TO DECLARE LONG_INTEGER IN ADA?

DEC Ada, package SYSTEM includes the values of various machine constants:

        MAX_INT: constant:= 2**31-1;
        MIN_INT : constant:= -(2**31);

        type INTEGER_32 is range -2_147_483_648 .. 2_147_483_647;
        for INTEGER_32'SIZE use 32;

        type LARGEST_INTEGER is range MIN_INT .. MAX_INT;

Hope this helps.




^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: HELP:Declaration in ADA?!!
@ 1996-03-25  0:00 tmoran
  0 siblings, 0 replies; 13+ messages in thread
From: tmoran @ 1996-03-25  0:00 UTC (permalink / raw)


>DOES SOMEONE KNOW HOW TO DECLARE LONG_INTEGER IN ADA?
  type LONG_INTEGER is range -2**31 .. 2**31-1; -- or whatever
That might be appropriate, say, if you are doing something with
mathematical number theory.  If you are dealing with distances
or high voltage power lines then
  type meters is range -1_000_000 .. 1_000_000;
  type Volts is range -500_000 .. 500_000;
might be more appropriate names than 'Long_Integer'.




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

end of thread, other threads:[~1996-04-24  0:00 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
1996-03-28  0:00 ` Ken Devlin
1996-04-08  0:00 ` Ken Devlin
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
1996-04-09  0:00   ` Walter B. Hollman Sr.
  -- 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

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