상세 컨텐츠

본문 제목

Write A Program To Compute Exponential Series

카테고리 없음

by dromesquanet1979 2020. 3. 1. 22:17

본문

  1. Maclaurin Series In C
  2. C++ Program For Exponential Series
Write

I would assume math.exp is the better choice: The pow function (which is what. is a shortcut for) converts both items to the same type as its first step, which means that math.e will be rounded to float(2.59045) immediately.

Maclaurin Series In C

Write a program to compute exponential series sum

C++ Program For Exponential Series

This seems like a lot of precision, but the rounding error will become more and more important with higher exponents. I don't know the internals, but I would guess that the math.exp algorithm produces the actual value of e^x and then converts that result into a float. So the difference is probably that one rounds before and the other rounds afterwards.–Jul 9 '13 at 17:19.