Fast_atof incorrectly parsing some floats (which are correctly read by standard atof).
fast_atof("0.43701171875") evaluates to 0.007 instead of 0.437
Error is in "u32 strtol10". It is trying to "atol" value 43701171875 which is bigger than u32 which is causing u32 (DWORD) overflow which is leading to wrong number. i suggest to add limitation to number of characters read after '.' symbol, since they are not that significant at all.
The number itself was exported by script from another software so i think its worth a fix
[fixed]fast_atof bug'n'suggestion
It also has troubles with floats, see here: http://irrlicht.sourceforge.net/phpBB2/ ... highlight=
(sorry, I did see this thread only afterwards).
(sorry, I did see this thread only afterwards).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
-
- Admin
- Posts: 3590
- Joined: Mon Oct 09, 2006 9:36 am
- Location: Scotland - gonnae no slag aff mah Engleesh
- Contact:
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way