I am trying to replicate the following formula from Excel in to a C# app and the result is different.
The answer where x=5 should be y=55.249875 which I have just done using Windows calculator and matches to the Excel answer.. but not when I try it in C#.
For E I use Math.Exp and for x^y I use Math.Pow().
Any ideas?
Formula:
y = -1E-06x^6 + 0.0001x^5 - 0.0025x^4 + 0.0179x^3 + 0.0924x^2 - 0.6204x + 55.07
This would be:
Here is a fully working test program to demonstrate:
I think the confusion was that you were assuming that -1E-06 required
Math.Exp, but it does not. This is just a simple number in Scientific Notation.