comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <dont.bother.mcondic.auntie.spam@[acm.org>
Subject: Re: Naturals and discrete types
Date: Fri, 2 Nov 2001 10:05:31 -0500
Date: 2001-11-02T15:05:22+00:00	[thread overview]
Message-ID: <9rucni$ief$1@nh.pace.co.uk> (raw)
In-Reply-To: EtkE7.221650$K6.106545662@news2

It depends on what you want to do and what behavior you need from the
conversion.

Between your basic Integer and Float, you can use a standard type
conversion:

Integer_Thing    := Integer (Float_Thing) ;

However, depending on how you want to handle rounding/truncation, etc you
might want some other behavior. Look at Annex K - there are attributes that
will do just about anything you want. (Really! Annex K is your friend!
*LOTS* of powerful stuff in there. Read it thoroughly.)

MDC
--
Marin David Condic
Senior Software Engineer
Pace Micro Technology Americas    www.pacemicro.com
Enabling the digital revolution
e-Mail:    marin.condic@pacemicro.com
Web:      http://www.mcondic.com/


"Clueless" <chris@dont.spam.me> wrote in message
news:EtkE7.221650$K6.106545662@news2...
>
> However, I'm still a little fuzzy on the best way to convert between real
> and discrete types.
>






  reply	other threads:[~2001-11-02 15:05 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-11-01 22:05 Naturals and discrete types Clueless
2001-11-01 22:35 ` Matthew Heaney
2001-11-01 22:59 ` Clueless
2001-11-02 15:05   ` Marin David Condic [this message]
2001-11-02 17:24 ` Ted Dennison
2001-11-02 18:19   ` Preben Randhol
2001-11-02 18:51     ` Marin David Condic
2001-11-03 18:01       ` Nick Roberts
2001-11-04  4:18         ` tmoran
2001-11-05 15:29           ` Marin David Condic
2001-11-04 11:39       ` Preben Randhol
2001-11-05  2:01         ` Clueless
2001-11-05  2:37           ` Larry Kilgallen
  -- strict thread matches above, loose matches on Subject: below --
2001-11-01 23:06 Beard, Frank
2001-11-01 23:20 ` Clueless
2001-11-02  3:05   ` DuckE
replies disabled

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