JAVA: Cleaning up an ugly equation
I have the following equation in java
Code:
class ex2 Like, how can I put the assignment of variable 'a' onto more lines. Curly brackets don't work like I thought they would |
Just split it over more lines, whitespace doesn't matter.
|
Store Math.pow(10, 3) in a variable. It won't cost that much space at all and might make it look a little cleaner
|
Quote:
I would probably do either this, Code:
class ex2 Code:
class ex2 |
Well you could just write it as
Code:
double a = 204938.95; |
Many thanks guys!
I didn't realise you could just put it on separate lines, I thought I needed curly brackets or something. |
And why would anyone in her right mind call pow(10,3) to calculate 1000?:scratch:
|
Quote:
|
All times are GMT -5. The time now is 02:18 AM. |