From: mcmorran@visi.net (Peter McMorran)
Subject: Re: Convertion of string to float
Date: 2000/11/18
Date: 2000-11-18T00:00:00+00:00 [thread overview]
Message-ID: <3a170d3c$1$zpzbeena$mr2ice@news.visi.net> (raw)
In-Reply-To: wccvgtqwqu2.fsf@world.std.com
In <wccvgtqwqu2.fsf@world.std.com>, on 11/14/00
at 02:50 PM, Robert A Duff <bobduff@world.std.com> said:
>jordan <huikeith@hotmail.com> writes:
>> How can i convert an array of character to integer???
>> Or
>> How can i convert a string to float???
>> (The case is that i get a string from the terminal, and i need to make
>> part of it as a float number, how can i do??)
>Look up the Image and Value attributes.
Or use Float_IO.Get from Text_IO. One version of get takes a
string as input. You need to instance Float_IO for the type you
want to read, i.e. float. This gives you a clearly-defined
exception interface, in case the string is badly formatted.
Cheers,
Peter
--
-----------------------------------------------------------
mcmorran@visi.net (Peter McMorran)
-----------------------------------------------------------
prev parent reply other threads:[~2000-11-18 0:00 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-11-14 0:00 Convertion of string to float jordan
2000-11-14 0:00 ` Robert A Duff
2000-11-18 0:00 ` Peter McMorran [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox