Hi guys, we are developing a GWT-project with a lot of shared files. We discovered a few discrepancies in the gwt-math and server-math and wanted to share them for anybody else having those issues:
- First and foremost: all native double calculations are identical (+ - * / %) - All trig-functions (sin,cos,tan,asin,acos,atan,atan2) seem to produces slightly different results. We recommend doing your own impl using lookup-maps - sqrt,log and pow seem to be identical although we only tested sqrt thoroughly - As far as we know all functions like max,min,abs etc are identical - toDegrees and toRadian are actually different because GWT uses a constant for 180./PI and PI/180. which changes the order of operation compared to java - For serialization of doubles we strongly suggest using Double.doubleToLongbits and Double.longBitsToDouble. You can additionally use Long.toString(long,32) and Long.parseString(string,32) to compress the String-representation I hope we can help some people with this info. Especially the toDegrees/toRadians was very surprising to find. This issue was reported though and might be fixed in a future GWT-version (we tested 2.6.1). In case you are interested how we solved the issues here is the open-source-part of our project <https://xp-dev.com/sc/182005/HEAD/%2FGWTCommon%2Fsrc%2Fcom%2Funiverseprojects%2Fcommon%2Fshared%2Fmath> so you can check it out Regards Oskar Stangenberg -- You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscr...@googlegroups.com. To post to this group, send email to google-web-toolkit@googlegroups.com. Visit this group at http://groups.google.com/group/google-web-toolkit. For more options, visit https://groups.google.com/d/optout.