Problems with BigDecimal
Edouard G. Parmelan
egp at free.fr
Tue Jan 30 08:08:10 PST 2001
Sergey Voitseh wrote:
> The results on JDK are
>
> bd befor = 0
> bd+10 = 10
> bd*10 = 100
> bd-11 = 89
> bd/10 = 8
>
> The results on Kaffe are
>
> bd befor = 0
> bd+10 =
> 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000999941655801798404285768013137759788350539262707304543507630776310404900973869738459858768736254360829937318372449872837461709555186899251809854663064321974132625278579327762026893497093072124442702104753231701657908336972120671850130432016665702645671803049463305139787315279428437570044378858627898028886678805881760452010092053748347212777556221795060564772977647097020148230760162451554270655183497056526193119373791926341249767815235923411391160825048305755026376692907906271544734775979010821050147017036901176543355921022886577490531475902208158340237889632207099381390340712069365067214501772473709440760049111929484202151523627928938679861001439920833984166232003870425974526902931836499096
> 324675715794686247654587988003458945772425
> bd*10 =
> 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004061802509884334022345072578876711882371411629430191869759980790282152954148650188388627948079369686292349326967765643698460515551040755654802548583602114602581030268028917077257498671097771966322330853797065966325218577946843938761879320228524382563468118523614645928475706348136484545956478351346598777393907089849641521119375937619930358284298815197888096159486173806285959161808189
Very strange :-(
Did you test with _same_ compiled class ? Or did you compile with Sun
javac for JDK test and Kaffe javac (aka kjc) for Kaffe test.
Could you test Sun compiled Test.java with Kaffe ?
What's the result of System.out.println (new BigDecimal ((double)10))
and so one.
If you use kjc I suggest you to retreive my patched version at
http://egp.free.fr/kaffe and also include in CVS Tree of kaffe:
$ kjc --version
version number: 1.4F-cvs20000716-egp1
--
Edouard G. Parmelan
http://egp.free.fr
More information about the kaffe
mailing list