comp.lang.ada
 help / color / mirror / Atom feed
From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
Subject: Re: TRUNCATE a FLOAT  [ 3,45 ]  ->  [ 3 ]
Date: 2000/02/06
Date: 2000-02-06T00:00:00+00:00	[thread overview]
Message-ID: <P3cn4.5603$563.256373@newsread1.prod.itd.earthlink.net> (raw)
In-Reply-To: 87ich2$pmk$1@bw107zhb.bluewin.ch


helder da silva <pc-tech@bluewin.ch> wrote in message
news:87ich2$pmk$1@bw107zhb.bluewin.ch...
> Anyone remembers how to truncate the first part of a float number :
>
> FROM ( float ) :  3,45
>
> TO ( integer )  :  3
>
> I've got a blank on this one !
>
> Thanks.
>
given the declarations

X : Float;
Y : Integer;

you can write

Y := Integer (Float'Floor (X));






  reply	other threads:[~2000-02-06  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-02-06  0:00 TRUNCATE a FLOAT [ 3,45 ] -> [ 3 ] helder da silva
2000-02-06  0:00 ` David C. Hoos, Sr. [this message]
2000-02-06  0:00 ` Jeff Carter
2000-02-06  0:00   ` helder da silva
replies disabled

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