From: Arno P. <ar...@pu...> - 2010-11-08 19:28:10
|
I'm assuming that the location-API in iOS is already using double. In that case we should also just offer doubles in the Java-API. The programmer needs to know about the consequences of using double; both in Java and in Objective-C. Arno On 11/8/10 8:38 AM, Panayotis Katsaloulis wrote: > > On Nov 8, 2010, at 6:11 PM, Paul Poley wrote: > >> Checking equality on double or float values is always fishy. Unfortunately BigDecimal hasn't yet become a priority, but that would be a much safer implementation. It doesn't lose precision, making it a good candidate for sensitive numbers, such as currency calculations. >> >> If you do go down that route though, make sure to use "compareTo" and not "equals". E.g. "5.40" does not "equals" "5.4", but "compareTo" will return 0. Forgive me if I am stating anything you already know. >> >> Paul Poley > > > The problem unfortunately is under Obj-C code and not Java. > :) > > I agree with you, but right now, after doing some tests, I have the feeling that actually these values are used by iOS SDK more as a reference (and is checked for being larger/smaller than the specified value) and not really for equality. > Thus I believe that it will be safe to use double values, for now. > ------------------------------------------------------------------------------ > The Next 800 Companies to Lead America's Growth: New Video Whitepaper > David G. Thomson, author of the best-selling book "Blueprint to a > Billion" shares his insights and actions to help propel your > business during the next growth cycle. Listen Now! > http://p.sf.net/sfu/SAP-dev2dev > _______________________________________________ > xmlvm-users mailing list > xml...@li... > https://lists.sourceforge.net/lists/listinfo/xmlvm-users |