Ricardo,

Doubles are inherently imprecise because of the way they store floating point numbers. This is useful reading:

http://en.wikipedia.org/wiki/Floating_point

BigDecimal stores numbers in a non-lossy (albeit larger) format. I would suggest avoiding doubles if you need high precision, or just round the result if you don't.

One fun exercise, if you have an Apple ][ handy - is to type:

print 7*7

at the BASIC prompt.  The answer?

49.000000000001

:)

Ken

On Nov 5, 2006, at 9:02 AM, Ricardo Strausz wrote:

Hola Kieran!

Do you mean java.math.BigDecimal?
If so, does this means that java cannot add two double numbers without a math library?

wired!

My first guess was to blame the tranport (SOAP or XML-RPC)... but I do not have experience with these...

How does precision have to do with my PPC?
Does someone know the differences between the precision in Objective-C and in Java?

Any how, I will rewrite it with BigDecimals and let you know...

Dino

On Nov 5, 2006, at 6:47 AM, Kieran Kelleher wrote:

The Calculator.java _example_ uses double ..... why not revise it to use BigDecimal instead?

Kieran

On Nov 4, 2006, at 8:35 PM, Ricardo Strausz wrote:

Hola!

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?

Dino
_______________________________________________
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/kieran_lists %40mac.com

This email sent to [EMAIL PROTECTED]


_______________________________________________
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/lists% 40anderhome.com

This email sent to [EMAIL PROTECTED]

_______________________________________________
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