Policies & Guidelines

POLYNOMIAL

Calculate polynomial series

Description

Given an array of numbers such as \[a, b, c\], calculates the sum c*x⁰ + b*x¹ + a*x². If there are more elements in the array, the series is continued.

If the given array is empty, returns 0.

Function signature

POLYNOMIAL(xvalue: Number, coefficientsa: Array) => Number

Parameter

Description

X value

The input value to the power series.

Coefficients A

The coefficients by which each successive power of x-value is multiplied.

Examples

Formula

Return value

POLYNOMIAL(10, [1, 3, 9])

139

POLYNOMIAL(5, [1, 3, 9])

49

POLYNOMIAL(-5, [1, 3, 9])

19

POLYNOMIAL(5, [-1, 3, 9])

-1

POLYNOMIAL(10, [1])

1

POLYNOMIAL(10, [])

0