Hi,
I'm experiencing a problem with JamVM on a TS-7250 in which some float
values are corrupted.
I can reproduce the problem if I run the following Java program:
public class Test {
public static void main(String[] args){
float a, b, c;
a = 45f;
b = 10f;
c = a/b;
System.out.println("" + c + " = " + a + "/" + b);
}
}
:root# /usr/bin/jamvm -cp . Test
4.000007 = 45.0/10.0
As you can see, the result ought to be 4.5, not 4.000007. With other
testing, I see odd float values, like ".005:389" for example.
I am using this version of JamVM:
:root# jamvm -version
java version "1.4.2"
JamVM version 1.4.4
Executing the same code on a Windows JVM produce the correct result of
4.5.
Similarly, executing the following C program produces the correct
result, so the problem only manifests in Java:
void main(void) {
float a,b,c;
a=45.0;
b=10.0;
c=a/b;
printf("%f=%f/%f\n",c,a,b);
}
:root# gcc t.c -o t
t.c: In function `main':
t.c:1: warning: return type of `main' is not `int'
:root# ./t
4.500000=45.000000/10.000000
Any ideas?
Thanks very much,
Ted
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|