Created
June 9, 2015 23:19
-
-
Save bowbahdoe/ea3ef3dbfa10d70d3582 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| float evaluatePolynomial(int array[], | |
| int arrayLength, | |
| float xValue) | |
| { | |
| //Evaluates the polynomial at a given point | |
| //So if you get passed in {1,2,3}, thats | |
| //the same as X^2+2X+3 and {1,4,4,6,7,8} | |
| //is X^5+4X^4+4X^3+6X^2+7X+8 | |
| //So {1,2,3},3,3.4 should return the result | |
| //of (3.4)^2+2*(3.4)+3 | |
| } | |
| int main() | |
| { | |
| //one Test Case, make your own to test other things | |
| int array[3] = {1,2,3}; | |
| float value = evaluatePolynomial(array,3,2.3); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment