At 10:04 12/05/99 +0200, Alessio Dragoni wrote:
>Hi
>
>       I try to run the code appended at the end of this message on v1.2pre1
>       on linux and in the jdk1.2 and jdk1.2.1 on Win and the result is
>       that 0.3*3 is equals to 0,89999999999 and not simply to 0.9   !!!
>
>       is this a bug or what?
>
>       trying to run this one and you can see it!
>       Anyone knows some bug-fix to resolve this strange
>       error ?
>
>       any comments are welcome!
>
>       bye Alessio
>

Thats not a bug, thats just typical behaviour with floating point
algorithm, try to compile and run this little C program on your linux machine:

#include <stdio.h>
void main() {
  double d1 = 0.3, d2 = 3, d3;

  d3 = d1 * d2;

  printf("%20.20lf", d3);
}

-------------------- Marble Consulting ----------------------
Gerrit Cap                      http://www.ping.be/marble
OO Solutions Engineer           mailto:[EMAIL PROTECTED]
Marble Consulting                      
Blauwe Gaanweg, 53              tel : +32 75 72.94.36
B-9150 Kruibeke-Bazel           fax : +32 3 744.19.17          
Belgium                


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to