[ECOS] [Fwd: [ECOS] printf and floating point emulation]

Andrew Lunn andrew@lunn.ch
Wed Apr 9 18:24:00 GMT 2008


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



More information about the Ecos-discuss mailing list