File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Java
»
Beginning Java
Author
x+=a and x=x+a
mantravadi murali
Greenhorn
Joined: Jun 06, 2001
Posts: 1
posted
Jun 06, 2001 05:00:00
0
<pre>
int x;
x = x+0.1;
gives an error.
while......
x += 0.1
doesn't give an error.
Art Metzer
Ranch Hand
Joined: Oct 31, 2000
Posts: 241
posted
Jun 06, 2001 05:53:00
0
Hi, Mantravadi.
You don't get any compilation error in the second case because
x += 0.1;
is equivalent to
x = (int) ( x + 0.1 );
Art
I agree. Here's the link:
http://ej-technologies/jprofiler
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: x+=a and x=x+a
Similar Threads
Missing Numeric Suffixes
different between java 1.5 and 1.6
Percision problems with Double and Float numbers
cut off decimals of a float number
what accounts for precision problems when computing floating point numbers?
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter