Excel GoalSeek algorithm

前端 未结 3 2079
误落风尘
误落风尘 2021-01-06 03:55

Does anyone have the code for this algorithm ? Any C-based programming language would be OK but I prefer C#.

I could try to implement it but I\'m sure I\'m not the f

3条回答
  •  半阙折子戏
    2021-01-06 04:52

    Have a look at:

    https://www.nuget.org/packages/TridentGoalSeek/

    Your algorithm needs to implement the IGoalSeekAlgorithm interface. Then usage is as follows:

    var myAlgorithm = new MyAlgorithm(90463.45M, 200);
    var goalSeeker = new GoalSeek(myAlgorithm);
    var seekResult = goalSeeker.SeekResult(96178.21M);
    

提交回复
热议问题