Alyssa R.

asked • 06/10/20

Float function (computer coding)

  1. What does this function do?

float function(int n) {

float result = 1.0;

float factor = 1.0 + 1.0 / n

for (int i = 0; i <n; ++i) {

result = result * factor

}

return result;

}

  1. Compute an approximation of sqrt(2)
  2. Compute an approximation of e
  3. Compute an approximation of sin(n)
  4. Compute an approximation of pi


1 Expert Answer

By:

Patrick B. answered • 06/10/20

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.