sprintf weirdness
"Andras Balogh" <[email protected]>
| Newsgroups | gmane.games.devel.windows |
|---|---|
| Message-ID | <[email protected]> |
Hi, In a normal app, when I write this: sprintf(buf, "%.3f", 0.05f); the contents of buf will be "0.050". But in my app, the result is "0." instead!! The magic barrier seems to be 0.1, as numbers above that (or below -0.1) work OK. Now how's that? Is this a denormal issue?? 0.1 is quite big, isn't it? Still, I suspect that the problem lies in me having my own crt0 (don't ask why :) but I believe I do all the floating point initializations that the original crt0 does (it calls _fpmath(1); or (*_Fpinit)(1); whichever is defined somewhere (which btw only sets the FPU control word AFAICT), but it's still not working the way it should... What is happening here?? I've tried to trace sprintf, but in the end it just uses a function called _cfltcvt, which is totally undocumented and the only thing I could do is reverse engineer the assembly code, which I'd rather not do.. Any ideas what's causing this behavior?? Thanks, Andras ------------------------------------------------------- This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools! Get your free copy of BEA WebLogic Workshop 8.1 today. http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click _______________________________________________ Gamedevlists-windows mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows Archives: http://sourceforge.net/mailarchive/forum.php?forum_id=555