This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Different results of java and C verion of same program ?
- From: David BalaÅic <david dot balazic at hermes dot si>
- To: java at gcc dot gnu dot org
- Date: Fri, 03 Mar 2006 12:31:56 +0100
- Subject: Different results of java and C verion of same program ?
Hi!
I use gcc 3.3.5 (debian 3.1).
*
I have written a program in jav*a and compiled it with gcj.
Then I ported it to C and compiled with gcc.
They give different results !
What the program does :
- load point 4D coordinates from a an ASCII file
(format is one point per line, like :
0.146584576854345 0.234453109584343 0.544867765645423
the values are mostly between 0 and 1 , about 15 decimals)
- convert values to double
- compute distance between points
- sort distances and print it out (sorted)
The java version gives slightly different output than C.
Also if I modify the C version to use "long double" type
instead of "double" I get again different results (this time more
similar to the C result).
Can this be some compiler error ?
Computing accuracy related ?
Regards,
David