* float2string
@ 2002-03-06 15:19 Pedro Jose Garcia Gil
2002-03-06 15:51 ` float2string David C. Hoos
0 siblings, 1 reply; 2+ messages in thread
From: Pedro Jose Garcia Gil @ 2002-03-06 15:19 UTC (permalink / raw)
Hello.
I want to send a float by the serial port.
In C, I use the function "buffer=fcvt(source,7,&decimal,&signo);". I have
tried to import this function from C to Ada95, but I have had problems with
the char pointer (char *buffer). I don't know how to manage with the
equivalent in Ada to a char pointer.
Can I convert a float to a string in Ada?. How?.
Thank you very much.
Pedro.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: float2string
2002-03-06 15:19 float2string Pedro Jose Garcia Gil
@ 2002-03-06 15:51 ` David C. Hoos
0 siblings, 0 replies; 2+ messages in thread
From: David C. Hoos @ 2002-03-06 15:51 UTC (permalink / raw)
----- Original Message -----
From: "Pedro Jose Garcia Gil" <pggil@isa.upv.es>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Wednesday, March 06, 2002 9:19 AM
Subject: float2string
>
> Hello.
> I want to send a float by the serial port.
>
> In C, I use the function "buffer=fcvt(source,7,&decimal,&signo);". I have
> tried to import this function from C to Ada95, but I have had problems
with
> the char pointer (char *buffer). I don't know how to manage with the
> equivalent in Ada to a char pointer.
>
> Can I convert a float to a string in Ada?. How?.
>
You can use the attribute function Float'Image (<float-expression>) to
obtain a
scientific notation string.
If you want a particular format, you can use the Put procedure described in
the LRM A.10.9 (30)
> Thank you very much.
>
> Pedro.
>
>
>
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-03-06 15:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06 15:19 float2string Pedro Jose Garcia Gil
2002-03-06 15:51 ` float2string David C. Hoos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox