From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,a90718b61c5de714,start X-Google-Attributes: gid103376,public From: David Dessert Subject: assignments using different types Date: 1997/01/28 Message-ID: <32EE4431.6D24@ti.com>#1/1 X-Deja-AN: 212829852 content-type: text/plain; charset=us-ascii mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.01 (WinNT; I) Date: 1997-01-28T00:00:00+00:00 List-Id: I have a question about readability and efficiency of assignments when using strict types in Ada83. I'm using the TI-Tartan C40 compiler, which has few Ada95 features. Example: type Distance_Type is new float range 0.0 .. 1000.0; type Time_Type is new float range 0.0 .. 10.0; type Velocity_Type is new float; Distance : Distance_Type := 100.0; Time : Time_Type := 10.0; Velocity : Velocity_Type; ... -- A difficult to read, but legal Ada assignment. Velocity := Velocity_Type(float(Distance) / float(Time)); Can anyone provide me with suggestions to improve the readability of the above assignment? Of course, I'd like efficiency to be similar to that of using the same type for all the variables.