在GO
中評估數學公式,建議使用提供預先定義的功能和操作員的外部軟件包。一個受歡迎的選項是政府:
安裝goValuate:接口{},8) 參數[“ x”] = 8 result, err := expression.Evaluate(parameters)
In the above example:
NewEvaluableExpression: Creates an instance of EvaluableExpression that represents the formula.go get github.com/Knetic/govaluateparameters: A map that specifies the values to be used for the variables in the公式。
免責聲明: 提供的所有資源部分來自互聯網,如果有侵犯您的版權或其他權益,請說明詳細緣由並提供版權或權益證明然後發到郵箱:[email protected] 我們會在第一時間內為您處理。
Copyright© 2022 湘ICP备2022001581号-3