Ada Programming/Libraries/Ada.Numerics.Generic Complex Types


Ada Lovelace 1838.jpg

The generic package Ada.Numerics.Generic_Complex_Types defines complex type for a defined floating point type. Being generic it can not only be used for predefined floating point types but also for any user defined floating type.

UsageEdit

There is an extensive usage guide in Ada Programming/Mathematical calculations. Here the relevant extract:

File: numeric_7.adb (view, plain text, download page, browse all)
with Ada.Numerics.Generic_Complex_Types;

procedure Numeric_7 is

  type Value_Type is digits 12 range
     -999_999_999_999.0e999 .. 999_999_999_999.0e999;

  package Complex_Types is new Ada.Numerics.Generic_Complex_Types (
     Value_Type);

  use type Complex_Types.Complex;

See alsoEdit

WikibookEdit

Ada Reference ManualEdit

Ada 95Edit

Ada 2005Edit

Last modified on 22 March 2013, at 16:05