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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,d2a3144038a5a80e X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!news.glorb.com!wn14feed!worldnet.att.net!bgtnsc04-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Re: Question on types conversions - operations Reply-To: anon@anon.org (anon) References: <4a33cb0b$0$2848$ba620e4c@news.skynet.be> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Sat, 13 Jun 2009 16:55:21 GMT NNTP-Posting-Host: 12.65.132.143 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1244912121 12.65.132.143 (Sat, 13 Jun 2009 16:55:21 GMT) NNTP-Posting-Date: Sat, 13 Jun 2009 16:55:21 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:6457 Date: 2009-06-13T16:55:21+00:00 List-Id: How about : S := Speed ( L ) / Speed ( T ) ; I prefer simplier, convert to resulting type then preform the algorithm. In <4a33cb0b$0$2848$ba620e4c@news.skynet.be>, Olivier Scalbert writes: >Hello, > >I have the following three types: > type Length is new Float; > type Time is new Float; > type Speed is new Float; > >Suppose I need to compute a speed given a length and a time. > > L: Length := 100.0; > T: Time := 10.0; > S: Speed; > >How to do that ? > >With S := Speed(Float(L) / Float(T)) ? Mmmm ... not nice. > >With S := Speed(L / Length(T)), I am also not satisfy as I convert a >time in Length ... > >I am sure you have better ideas ! > >Good weekend, > >Olivier