On 5 Nov 2006, at 13:46, Ricardo Strausz wrote:

I am using doubles in both sides: the server and the client...
Shall I blame them?

You should. float and double are both floating point primitives in java; double offers more precision (the number of significant digits) than float. But, as pointed out, any type of float is inherently precise.

If you want to create a calculator object, it is a good idea to use BigDecimal. Java was originally designed as a PDA/set top box language, and its roots often show. Treat this as an opportunity to demonstrate the benefits of encapsulation in an object oriented design :-).

Paul


On Nov 5, 2006, at 3:47 AM, Paul Lynch wrote:


On 5 Nov 2006, at 01:35, Ricardo Strausz wrote:

Playing with WOWS and Cocoa I found that even a simple sum, is buggy...

I'd published the Calculator.java example from WO and consume it with WebServicesCore.framework in a very straight-forward way (the details are in http://strausz.blogspot.com/2006/11/consuming- calculatorjava-ws.html ); while adding 3.4 to 6.6, instead of 10.0 I did get 9.999998099999999 ... close, but not correct =:+(

To whom I shall blame?

At a guess - blame floats.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to