comp.lang.ada
 help / color / mirror / Atom feed
* Question on types conversions - operations
@ 2009-06-13 15:51 Olivier Scalbert
  2009-06-13 16:13 ` Robert Matthews
                   ` (5 more replies)
  0 siblings, 6 replies; 16+ messages in thread
From: Olivier Scalbert @ 2009-06-13 15:51 UTC (permalink / raw)


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



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2009-06-15 19:37 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-13 15:51 Question on types conversions - operations Olivier Scalbert
2009-06-13 16:13 ` Robert Matthews
2009-06-13 16:55 ` anon
2009-06-13 16:58 ` Dmitry A. Kazakov
2009-06-13 16:59 ` sjw
2009-06-13 17:24   ` Martin
2009-06-13 19:35     ` sjw
2009-06-14  8:22     ` sjw
2009-06-15  8:40   ` Jean-Pierre Rosen
2009-06-15  9:30     ` Olivier Scalbert
2009-06-15  9:51       ` stefan-lucks
2009-06-15 10:33     ` AdaMagica
2009-06-15 19:37     ` sjw
2009-06-13 19:56 ` Jeffrey R. Carter
2009-06-14 15:55   ` Robert A Duff
2009-06-15  8:52 ` AdaMagica

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox