Section 17.6 - Other Ada Capabilities

Here are some other Ada capabilities that we haven't covered so far but which you may be interested in:

  1. Ada 95 also provides a "modular" type, which is an integer that varies from zero up to some integer modulus-1. Unlike a normal integer, if you add or subtract a value and the result doesn't fit, the result wraps around. For example, a modulus 4 value can have the values 0, 1, 2, and 3. If you added one to 3, you'd get 0 (due to wrapping around). Modular types don't need to be powers of two, but if they are the Ada compiler will select especially efficient operations to implement them. Bit manipulation operations, such as and and or can be used on modular types.
  2. Ada provides a "fixed point" type; these are basically integers that the Ada compiler will automatically scale so that they can be used as though they were floating point numbers. This combines the exactness and speed of integers (which on many machines are faster than Floats) with the convenience of floating point numbers.
  3. Ada 95 has a number of predefined mathematical operations, including a random number generator, trigonometric and logarithmic operations, and complex numbers.
  4. Ada 95 has a number of predefined Character handling subprograms (to upper case, to lower case, etc) and string mapping subprograms (to create sets of characters for translation and word edge detection).
  5. Normally Ada only permits access values to reference information allocated by the new operator. As discussed in lesson 12, you can create a general access types that can access any value of the given type. Such a type can access anything of that value, as long as it is marked as aliased. You can even alias local variables, which in many cases is dangerous. Ada includes a set of accessibility rules that protect against dangerous uses, which can be overridden if necessary. This is explained with some examples in the Ada Rationale, part I, section II.6.
  6. Ada 95 compilers that support the information systems annex (annex F) also support packed decimal types, a type needed for many business programming problems.


There is no quiz question for this section.

You may go to the next section.


You may also:

PREVIOUS Go back to the previous section

OUTLINE  Go up to the outline of lesson 17

David A. Wheeler (dwheeler@dwheeler.com)

The master copy of this file is at "http://www.adahome.com/Tutorials/Lovelace/s17sf.htm".