comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Clubley <clubley@remove_me.eisner.decus.org-Earth.UFP>
Subject: Re: Integer Overflow Question.
Date: Mon, 25 Aug 2014 17:40:58 +0000 (UTC)
Date: 2014-08-25T17:40:58+00:00	[thread overview]
Message-ID: <ltfsf9$arp$1@dont-email.me> (raw)
In-Reply-To: 84ce2caf-0a48-4952-8703-af1c0fabe583@googlegroups.com

On 2014-08-25, austin.obyrne769@btinternet.com <austin.obyrne769@btinternet.com> wrote:
> On Monday, August 25, 2014 2:34:29 PM UTC+1, Aay Jay Chan wrote:
>> From the fact that you don't know how big your types are, it sounds like you are using pre-defined types. In Ada, the prefered way is to define your own types with the range that matches your requirements. That way, you will know, at compile time, whether the compiler can implement those types on the target platform.
>
> Apologies
>
> I haven't just learned that I can do that.
>
> I have indeed been using pre-defined integers and was quite unaware
> that I could define my own types with a suitable range - I have only
> just learned that from another source.
>

Austin, the following is a polite and well intentioned suggestion.

User defined data types with user defined ranges are a core capability
within Ada's range of features.

Although I am a professional programmer, my interest in Ada is only
personal, and not work related. However, that doesn't change the fact
I found out about this capability within Ada very shortly after
starting to explore Ada years ago.

My suggestion is for you to pick up an Ada book or maybe look at an
online resource and learn about the other things Ada can do.

When I was beginning Ada I found things like Ada Distilled to be of
interest and I see it is still online in various forms. I also have
paper books such as the Barnes "Programming in Ada 95", second edition
and "Ada as a second language" by Cohen in my library.

I would recommend you start with Ada Distilled and see how you get on
with that before buying any books. Also, before buying any books, I
recommend you ask here for advice on what the current recommended books
are.

The Ada reference manual is also available online and for downloading.

> You see, I am not a well informed programmer and I am also pre-occupied with the maths and the cryptography as well as The Ada side of things.
>

If you are creating crypto schemes, you _really_ need to be skilled in
your implementation language of choice.

> Please Mr Chan, 
>
> Could you please set out the Ada-95 sourcecode for defining an integer variable called "CipherText" in the range say of 8 decimal digits to 12 decimal digits. I can do the others myself once I know what to do.
>

If you don't know this about Ada, it's not something which should be
done by rote. However, if you work through an Ada introduction, this
basic capability is something you should be able to do yourself.

Simon.

-- 
Simon Clubley, clubley@remove_me.eisner.decus.org-Earth.UFP
Microsoft: Bringing you 1980s technology to a 21st century world


  parent reply	other threads:[~2014-08-25 17:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25 11:21 Integer Overflow Question austin.obyrne769
2014-08-25 11:46 ` G.B.
2014-08-25 12:58   ` austin.obyrne769
2014-08-25 13:09     ` Simon Clubley
2014-08-25 13:29       ` austin.obyrne769
2014-08-25 13:44         ` Simon Clubley
2014-08-25 13:34     ` Aay Jay Chan
2014-08-25 15:09       ` austin.obyrne769
2014-08-25 17:02       ` austin.obyrne769
2014-08-25 17:21         ` Simon Wright
2014-08-25 17:56           ` austin.obyrne769
2014-08-25 19:38           ` austin.obyrne769
2014-08-25 17:40         ` Simon Clubley [this message]
2014-08-25 18:09           ` austin.obyrne769
2014-08-25 12:20 ` gautier_niouzes
2014-08-25 12:54   ` austin.obyrne769
replies disabled

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