LEC03_Notes

# LEC03_Notes - 1 14:440:127 Introduction to Computers for...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2 cout << "Ceiling u = " << u << " rounds it up to " << ceil(u) << endl; cout << "Ceiling v = " << v << " rounds it up to " << ceil(v) << endl; // floor(): Floor, always rounds down cout << "Flooring u = " << u << " floors it down to " << floor(u) << endl; cout << "Flooring v = " << v << " floors it down to " << floor(v) << endl; // to calculate the cosine of x (radians) cout << "The cosine of x = " << x << " radians is " << cos(x) << endl; // to calculate the sine of x (radians) cout << "The sine of x = " << x << " radians is " << sin(x) << endl; // to calculate the tangent of x (radians) cout << "The tangent of x = " << x << " radians is " << tan(x) << endl; // to calculate exponential e to the power of variable cout << "e^"<< z << " = "<< exp(z) << endl; // to take square root of a positive number cout << "The square root of y = " << y << " is " << sqrt(y) << endl; // to calculate absolute value of variable cout << "The absolute value of v = " << v << " is " << fabs(v) << endl; // to calculate the natural logarithm of x (base e) cout << "The natural log of u = " << u << " is " << log(u) << endl; // to calculate the logarithm of x (base 10) cout << "The base 10 logarithm of x = " << x << " is " << log10(x) << endl; return 0; } You should definitely write/compile/run this code, so that you can become familiar with using the
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern