Double operators
Author |
Message |
Homer_simpson
|
Posted: Fri Feb 13, 2004 11:33 pm Post subject: Double operators |
|
|
is there a way to add and subtract doubles? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Paul
|
Posted: Fri Feb 13, 2004 11:36 pm Post subject: (No subject) |
|
|
double IS a kind of variable right? I dunno, cause thats the only way I've seen it. So, I hope Im not making a fool of myself here, but don't you just use JOptionPane.showInputDialog, take strings, put them in variables, then use Double.parseDouble, and put them strings into new variables, and subtract them? or add them? I dunno... if you wanted to user input the doubles, you could use it. |
|
|
|
|
|
wtd
|
Posted: Fri Feb 13, 2004 11:38 pm Post subject: (No subject) |
|
|
code: | import java.lang.*;
import java.io.*;
class TestDoubleOps
{
public static void main(String[] args)
{
double d = 7.2;
d = d - 2.5;
d = d + 3.4;
}
} |
|
|
|
|
|
|
Homer_simpson
|
Posted: Sat Feb 14, 2004 2:30 am Post subject: (No subject) |
|
|
i mean Doubles not doubles.. |
|
|
|
|
|
wtd
|
|
|
|
|
|
|