This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: [Fwd: printf and floating point emulation]
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Eduardo Sabaj <esabaj at hasar dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Wed, 9 Apr 2008 18:57:26 +0200
- Subject: Re: [ECOS] [Fwd: [ECOS] printf and floating point emulation]
- References: <47FCE8F3.3060206@hasar.com>
On Wed, Apr 09, 2008 at 01:04:03PM -0300, Eduardo Sabaj wrote:
> I found that the problem is the function vfnprint () located in
> vfnprintf.cxx. It calls cvt() and this function calls modf(). This last
> function seems to be the problem. This is the code extracted from cvt() :
> ...
> for (p = endp - 1; integer; ++expcnt) {
> tmp = modf(integer / 10, &integer);
> *p-- = to_char((int)((tmp + .01) * 10));
> }
> ...
>
> This loop never ends!
>
> Am I omiting any patch? Please I need help. If you have any suggestion
> write me as soon as you can.
> Regards,
> Eduardo
Can you give a concrete example. Something like
main()
{
printf("%.2f\n, 3.141539);
}
which causes the problem. Does the value being printed matter?
What happens when you run the test program
packages/language/c/libc/stdio/current/tests/sprintf1.c
Thanks
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss