ts-7000
[Top] [All Lists]

[ts-7000] TS-7300 JAVA Problem

To:
Subject: [ts-7000] TS-7300 JAVA Problem
From: "gcworrell" <>
Date: Tue, 26 Sep 2006 21:49:35 -0000
Problem :
When printing a float or double as a String, the resulting string
interpretation of the value is wrong (i.e. not close to the original
value) and it contains non-numeric characters.

Below is a session log that contains:
A cat of a simple program called WriteTest
The results of the execution of WriteTest
The results of java ?version

<<< Log from MSISR started September 20, 2006, 17:12:45 >>>

:JAVA# cat
WriteTest.java                                            

class WriteTest
{                                                              

public WriteTest()
{                                                           
        super
();                                                               
}                                                                   
public static void main(java.lang.String[] args)
{                             
        double doubleValue = (double)
0.123456789;                              
        float floatValue = (float)
0.123456;                                    
        System.out.println("Double Value = "+doubleValue+"  Float
Value
= "+floatValue);                                                    
}                                                                   
}                                                                   
:JAVA# java
WriteTest                                                

Double Value = 0.=75073800938646879  Float Value =
0.070:679                   

:JAVA# java -
version                                                 

java
version "1.4.2"                                                     
     

JamVM version
1.4.3                                                            

Copyright (C) 2003-2006 Robert Lougher
<>                    

 :JAVA#

<<< Log from MSISR ended September 20, 2006, 17:14:07 >>>



NOTES :
The value stored in the variable appears to be correct.  The actual
program I was running when I found this problem seems to receive the
correct double or float value when used in computations.  The error
appears to be in the toString() method.

I had originally installed the stable version of JamVM on the TS-
7300, but it had lots of problems.  At first I thought it was the
java application, but the same application has run without problems
on many other java runtimes, including the IBM j9 that I used on an
ARCOM Vulcan PC104 CPU.  One of the items that jumped out at me was
that the file separator was coming up as a ":" instead of a "/". 
Once I saw that, I installed the testing version of JamVM.  Now
everything works correctly except the items noted here (or at least
I should say I haven't found any other problems).  I also tried
SableVM.  It performed exactly the same.

I've run the WriteTest application on several other platforms with
different runtimes, and it works correctly on all.

I've submitted this as a bug report to the Debian folks and have
recieved no reply.



Thanks for any help.  I'm busy trying work-arounds, such as :
(new Double(doubleValue)).toString()
But that produces the same results.

Please contact me if you need any additional information.  I'll be
in a real Jam (no pun intended) if I can't get this to work.









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/




<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU