Classpath-0.92+floats+patch+arm
15/04/2018 12:08
Hello,I encountered some problems when i tried to use the float type on myembedded board based on arm926ejs core.

Indeed with the following code:
/************************************************************************/public class helloworld{ public static void main(String argv[]){ double dvar = 0.1; float fvar = 0.1f; System.out.println(Hello
); System.out.println(
both of these should be 0.1:); System.out.println(double var = + dvar); System.out.println(float var = + fvar);
System.out.println(
double size = + Double.SIZE); System.out.println(float size = + Float.SIZE);
System.out.println(
); }}/************************************************************************/Here's what i get when i issue the following command:
# jamvm helloworldHello
both of these should be 0.1:
double var = 0.00000103455646584float var = 0.0004:3256
double size = 64float size = 32
After some researches i found a patch about the arm float parsinghttp://www.mail-archive.com/classpath-patches@gnu.org/msg08956.html
It seems to correct the problem, but is there someone who can explainexactly the problem ?On the other hand, i'd like to understand how the floats are managedinto the java code.

Since my hardware does not embed a FP unit and the linux kernel isdisabled how the float are processed ?regardsgreg

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
15/04/2018 12:08 - On Wed, 05 Mar 2008 07:57:13 -0500, Lew <lew@lewscanon.com> wrote,quoted or indirectly quoted someone who said :

On general principles I object to variable names that remotely looklike keywords.


var IS a keyword is some languages.


Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
15/04/2018 12:08 -
Pascal? Really? You're objecting on the basis of a conflict with Pascal?

Source is Usenet: comp.lang.java.help
Sign in to add a comment

Answer score: 5
15/04/2018 12:08 - On Tue, 4 Mar 2008 07:10:16 -0800 (PST), grp62 <grp62@yahoo.fr> wrote,quoted or indirectly quoted someone who said :

In standard Java you may not embed colons in the middle of numbers.


floats also must end with f.


float var = 0.0003256f;
var is a bad choice of variable name. It tells you nothing aboutabout the purpose. It also masquerades as a keyword. It is a keywordin Pascal.


Source is Usenet: comp.lang.java.help
Sign in to add a comment

eDiscover
Helpforce eDiscover provides technical articles updated each dayHelpforce eDiscover RSS feed contains the latest technical articles in RSS
Click the logo to go back to the main page
Search eDiscover
  
Categories

Click an icon to go to that category

Helpforce eDiscover contains articles about Microsoft Windows Helpforce eDiscover contains articles about Apple products and MacOS Helpforce eDiscover contains articles about Linux and POSIX operating systems Helpforce eDiscover contains articles about Helpforce Helpforce has a large variety of technical information and articles for you to read Helpforce eDiscover contains articles about databases, MYSQL, SQL Server Oracle Helpforce eDiscover contains articles about Java, JVM and the JRE Helpforce eDiscover contains articles about the QNX operating system Helpforce eDiscover contains articles about Oracle Solaris and Open Solaris Helpforce eDiscover contains articles about RISC OS, Acorn and the BBC Micro Helpforce eDiscover contains articles about Amiga and AmigaOS

Type your comment into the box below