| | |
why is double data type giving an garbage value
![]() |
hmm, you seem to be missing the w and h keys on your keyboard.
As to your "problem", your native program is probably setting the value to a 32 bit floating point number.
Double in Java is a 64 bit floating point number. Either use a 64 bit floating point data type in the native code or use float in Java which is 32 bit.
As to your "problem", your native program is probably setting the value to a 32 bit floating point number.
Double in Java is a 64 bit floating point number. Either use a 64 bit floating point data type in the native code or use float in Java which is 32 bit.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
http://docs.sun.com/source/806-3568/ncg_goldberg.html has the answers to that.
It's a must read for anyone working with floating point arithmetic.
Basically what you're seeing is the imperfection of the storage of floating point numbers in fixed precision numbers based on integers (which is how every computer stores them).
It's a must read for anyone working with floating point arithmetic.
Basically what you're seeing is the imperfection of the storage of floating point numbers in fixed precision numbers based on integers (which is how every computer stores them).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
Similar Threads
- C++: problam with data type(int,float,double) (C++)
- C++ enumerated data type help (C++)
- Combined data type arrays. (C++)
- C double data type emulation library (C)
- Help With Data-type Declaration Symbols (Pascal and Delphi)
Other Threads in the Java Forum
- Previous Thread: plz! its urgent
- Next Thread: Classpath
| Thread Tools | Search this Thread |
-xlint android api applet application array arrays automation bi binary blackberry block bluetooth chat class client code compile compiler component database developmenthelp eclipse error event fractal freeze functiontesting game gameprogramming givemetehcodez graphics gui health html hyper ide image int integer j2me j2seprojects java javac javaprojects jetbrains jni jpanel jtable julia learningresources lego linux list login loops mac main map method methods mobile myregfun netbeans newbie nonstatic notdisplaying number online pearl problem program programming project qt recursion scanner screen server set singleton sms sort spamblocker sql string swing system textfields thread threads time title tree tutorial-sample update variablebinding windows working xor






