This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Fwd: printf and floating point emulation]


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]