双串? [英] Double to string?
问题描述
如何将23.1这样的双精度转换为字符串?我不想使用
任何库函数,因为代码是用avr-gcc编写的,而我是/ b $ b不喜欢dtostrf()的方式已经实施。谢谢。
Rick
Hi,
How can I convert a double such as 23.1 to a string? I don''t want to use
any library functions because the code is being written in avr-gcc and I
don''t like the way dtostrf() has been implemented. Thanks.
Rick
推荐答案
Rick< rrquick @ nospam-com>在新闻中写道:3f ******** @ clarion.carno.net.au:
Rick <rrquick@nospam-com> wrote in news:3f********@clarion.carno.net.au:
如何转换双比如23.1到一个字符串?我不想使用
任何库函数,因为代码是用avr-gcc编写的,我不喜欢dtostrf()的实现方式。谢谢。
Hi,
How can I convert a double such as 23.1 to a string? I don''t want to use
any library functions because the code is being written in avr-gcc and I
don''t like the way dtostrf() has been implemented. Thanks.
不知道avr-gcc和dtostrf是什么。但是,您考虑过
sprintf吗?
思南。
-
A. Sinan Unur
as**@cornell.edu
删除破折号以获取地址
Don''t know what avr-gcc and dtostrf are. However, have you considered
sprintf?
Sinan.
--
A. Sinan Unur
as**@c-o-r-n-e-l-l.edu
Remove dashes for address
Spam bait: mailto:uc*@ftc.gov
Rick< rrquick @ nospam-com>写道:
Rick <rrquick@nospam-com> writes:
如何将诸如23.1之类的双精度转换为字符串?我不想使用任何库函数,因为代码是用avr-gcc编写的,我不喜欢dtostrf()的实现方式。谢谢。
How can I convert a double such as 23.1 to a string? I don''t want to
use any library functions because the code is being written in avr-gcc
and I don''t like the way dtostrf() has been implemented. Thanks.
我会参考PJ Plauger,_标准C库_。
另外,请阅读sprintf的GNU libc实现(但
你不喜欢它。)
-
我希望有一天能学会阅读。
似乎比写作更难。
- 理查德希思菲尔德
I would refer to P.J. Plauger, _The Standard C Library_.
Alternatively, read the GNU libc implementation of sprintf (but
you won''t like it.)
--
"I hope, some day, to learn to read.
It seems to be even harder than writing."
--Richard Heathfield
我不能使用sprintf因为avr-gcc版本不支持
(它是编译器)。我只对某些手册感兴趣
的方式有效地进行双字符串转换。谢谢
Rick
Ben Pfaff写道:
I can''t use sprintf because it''s not supported by the version of avr-gcc
(it''s a compiler). I''m only interested in some "manual" way of
efficiently carrying a double to string conversion. Thanks
Rick
Ben Pfaff wrote:
Rick< rrquick @ nospam-com>写道:
Rick <rrquick@nospam-com> writes:
如何将23.1之类的双精度转换为字符串?我不想使用任何库函数,因为代码是用avr-gcc编写的,我不喜欢dtostrf()的实现方式。谢谢。
How can I convert a double such as 23.1 to a string? I don''t want to
use any library functions because the code is being written in avr-gcc
and I don''t like the way dtostrf() has been implemented. Thanks.
我会参考PJ Plauger,_标准C库_。
或者,阅读sprintf的GNU libc实现(但是
你不会喜欢它。)
I would refer to P.J. Plauger, _The Standard C Library_.
Alternatively, read the GNU libc implementation of sprintf (but
you won''t like it.)
这篇关于双串?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!