- Code: Select all
double c = Math.sqrt(a*a + b*b);
and
- Code: Select all
double c = Math.sqrt(a^2 + b^2);
One of them gives me 1.0. The other gives me 6.4. Why? What is the difference between the two lines?
double c = Math.sqrt(a*a + b*b);
double c = Math.sqrt(a^2 + b^2);
double c = Math.sqrt(a**2 + b**2);
Users browsing this forum: No registered users and 0 guests