* NEED Float to ASCII Conversion function
@ 1995-04-05 0:00 Rodney Moore
1995-04-06 0:00 ` Stephen A. Leake
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Rodney Moore @ 1995-04-05 0:00 UTC (permalink / raw)
Does anyone have a good float to ascii conversion routine?
Thanks in advance.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: NEED Float to ASCII Conversion function
1995-04-05 0:00 NEED Float to ASCII Conversion function Rodney Moore
@ 1995-04-06 0:00 ` Stephen A. Leake
1995-04-06 0:00 ` Tucker Taft
[not found] ` <3m50cu$6r2@sarge.hq.Verdix.COM>
2 siblings, 0 replies; 5+ messages in thread
From: Stephen A. Leake @ 1995-04-06 0:00 UTC (permalink / raw)
package My_Float_IO is new Text_IO.Float_IO (MY_FLOAT);
A_Float : MY_FLOAT := 2.3;
A_String : STRING (1 .. 32); -- must be big enough
My_Float_IO.Put (To => A_String, Item => A_Float);
- Stephe
--
Stephen Leake, NASA Goddard Space Flight Center
email: Stephen.Leake@gsfc.nasa.gov
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: NEED Float to ASCII Conversion function
1995-04-05 0:00 NEED Float to ASCII Conversion function Rodney Moore
1995-04-06 0:00 ` Stephen A. Leake
@ 1995-04-06 0:00 ` Tucker Taft
[not found] ` <3m50cu$6r2@sarge.hq.Verdix.COM>
2 siblings, 0 replies; 5+ messages in thread
From: Tucker Taft @ 1995-04-06 0:00 UTC (permalink / raw)
Rodney Moore (HDTJ44A@prodigy.com) wrote:
: Does anyone have a good float to ascii conversion routine?
: Thanks in advance.
Have you tried Text_IO.Float_IO.Put? There is a version of it
that produces the result in a String rather than on a file.
In Ada 95, you can also just use Float'Image.
-Tucker Taft stt@inmet.com
Intermetrics, Inc.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: NEED Float to ASCII Conversion function
[not found] ` <dewar.798172536@gnat>
@ 1995-04-19 0:00 ` Gene Ouye
[not found] ` <dewar.798260131@gnat>
0 siblings, 1 reply; 5+ messages in thread
From: Gene Ouye @ 1995-04-19 0:00 UTC (permalink / raw)
dewar@cs.nyu.edu (Robert Dewar) wrote:
>
>I trust Gene that you know that Ada 95 provides this function in
>convenient form ( the Image function can be used for Float in Ada 95,
>but not in Ada 83)
>
YUP!! It made me very happy, too! Now we have it for ALL scalar
types (not just the discrete types) 8-)
But, like I said, I figured, (perhaps incorrectly) that the inquirer
was either doing a simple class exercise, or had recently discovered
that in Ada83 the 'Image attribute only worked on discrete types. So,
the Ada95 solution probably wouldn't help much (hmm, are we talking
Ada83 or Ada95 when someone poses a question... haven't I seen that
thread before? ;-)
Now if only the 'Image attribute let me give it all the parameters
that were in the Float_Io.Put procedure... then I'd really be happy.
;-)
--
Gene Ouye <geneo@rational.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: NEED Float to ASCII Conversion function
[not found] ` <dewar.798260131@gnat>
@ 1995-04-22 0:00 ` Keith Thompson
0 siblings, 0 replies; 5+ messages in thread
From: Keith Thompson @ 1995-04-22 0:00 UTC (permalink / raw)
In <dewar.798260131@gnat> dewar@cs.nyu.edu (Robert Dewar) writes:
> I was thinking of adding the extra parameters to the 'Img attribute of
> GNAT (it's ours so we can do what we like with it).
> 'Img is like 'Image except it can be applied to an object:
> PUT ("N = " & N'Img);
> it also doesn't output the silly blank before positive numbers
Unfortunately, it does include the silly blank.
Yes, I've complained to gnat-report.
--
Keith Thompson (The_Other_Keith) kst@thomsoft.com (kst@alsys.com still works)
TeleSoft^H^H^H^H^H^H^H^H Alsys^H^H^H^H^H Thomson Software Products
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2718
That's Keith Thompson *with* a 'p', Thomson Software Products *without* a 'p'.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~1995-04-22 0:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-04-05 0:00 NEED Float to ASCII Conversion function Rodney Moore
1995-04-06 0:00 ` Stephen A. Leake
1995-04-06 0:00 ` Tucker Taft
[not found] ` <3m50cu$6r2@sarge.hq.Verdix.COM>
[not found] ` <dewar.797427715@gnat>
[not found] ` <3mum7i$2cb@rational.rational.com>
[not found] ` <dewar.798172536@gnat>
1995-04-19 0:00 ` Gene Ouye
[not found] ` <dewar.798260131@gnat>
1995-04-22 0:00 ` Keith Thompson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox