home *** CD-ROM | disk | FTP | other *** search
- -- Chapter 7 - Program 3
- with Text_IO;
- use Text_IO;
-
- procedure MoreDers is
-
- -- Some floating point types
- type NEW_FLOAT1 is digits 5;
- type NEW_FLOAT2 is digits 5 range 1.0..12.0;
- type DER_FLOAT is new FLOAT;
- type LIM_FLOAT is new FLOAT range 0.0..555.5;
- subtype SUB_FLOAT is DER_FLOAT range -2.3..12.8;
-
- -- Some fixed point types
- type NEW_FIXED1 is delta 0.5 range 1.0..12.0;
- type NEW_FIXED2 is delta 0.05 range 1.0..12.0;
- type DER_FIXED is new NEW_FIXED1;
- type LIM_FIXED is new NEW_FIXED1 range 1.0..5.5;
- subtype SUB_FIXED is DER_FIXED range 2.1..2.8;
-
- -- Some CHARACTER types
- type DER_CHAR is new CHARACTER;
- type ALPHA_CHAR is new CHARACTER range 'A'..'Z';
- subtype HEX_CHAR is ALPHA_CHAR range 'A'..'F';
-
- -- Some enumerated types
- type DAY is (MON, TUE, WED, THU, FRI, SAT, SUN);
- type WEEKDAY is new DAY range MON..FRI;
- subtype BOWLING_DAY is WEEKDAY range WED..THU;
-
- -- Some floating point objects
- Direction : FLOAT;
- Speed : DER_FLOAT := 100.0;
- Length : LIM_FLOAT := 72.41;
- Size : SUB_FLOAT := 4.3;
-
- begin
-
- Direction := 1.2 + FLOAT(Length + LIM_FLOAT(Speed * Size));
-
- end MoreDers;
-
-
-
-
- -- Result of execution
-
- -- (There is no output from this program)
-
-