What is the correct way to obtain (-1)^n?

前端 未结 7 1581
清歌不尽
清歌不尽 2021-01-31 07:19

Many algorithms require to compute (-1)^n (both integer), usually as a factor in a series. That is, a factor that is -1 for odd n and 1 fo

相关标签:
7条回答
  • Many algorithms require to compute (-1)^n (both integer), usually as a factor in a series. That is, a factor that is -1 for odd n and 1 for even n.

    Consider evaluating the series as a function of -x instead.

    0 讨论(0)
提交回复
热议问题