comp.lang.ada
 help / color / mirror / Atom feed
From: "Björn Lundin" <b.f.lundin@gmail.com>
Subject: Re: casting types
Date: Fri, 03 Oct 2014 09:45:37 +0200
Date: 2014-10-03T09:45:37+02:00	[thread overview]
Message-ID: <m0lk5h$7hp$1@dont-email.me> (raw)
In-Reply-To: <0e236d4b-2ece-4179-850c-46a0572f8339@googlegroups.com>

On 2014-10-03 05:35, Stribor40 wrote:
> Ok basically what I want to do now is following...
> 
> I am trying to print out my float to the screen by doing following..
> 
> 
> Put(myFunction);
> 
> Where myFunction generates number 9.24543E-01 which is output to the screen..
> I can also output it like this 
> 
> Put(Item=>Float 'Truncation(120.00*myFunction),Exp=>0,Aft=>5);
> 
> to output  81.00000 to the screen.
> 
> 
> Now I would like to save this  81.00000 as an integer to some variable. Can you please show me how to do this please
> 
> 
> 
> 

declare
  An_Integer : Integer := Integer(Float'Truncation(120.00*myFunction));
begin
  Text_io.Put_Line(Integer'Image(An_Integer));
end;


--
Björn

  reply	other threads:[~2014-10-03  7:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-01  1:49 casting types Stribor40
2014-10-01  2:06 ` Jeffrey Carter
2014-10-01  2:13   ` Stribor40
2014-10-01  2:56   ` Stribor40
2014-10-01 13:18     ` Dennis Lee Bieber
2014-10-01 13:55       ` Stribor40
2014-10-01 14:23         ` G.B.
2014-10-01 17:16           ` Stribor40
2014-10-01 17:38             ` Dirk Heinrichs
2014-10-02  1:47               ` Dennis Lee Bieber
2014-10-01 18:11         ` Jeffrey Carter
2014-10-02  9:21         ` Brian Drummond
2014-10-02  9:24     ` Brian Drummond
2014-10-03  3:35       ` Stribor40
2014-10-03  7:45         ` Björn Lundin [this message]
2014-10-03  8:29         ` Jacob Sparre Andersen
2014-10-06 23:36           ` brbarkstrom
2014-10-07  0:03             ` Jeffrey Carter
2014-10-07  0:21               ` brbarkstrom
replies disabled

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