📄 advmath.cpp
字号:
/* * * * */#include <iostream>#include <cmath>#include "advmath.h"#include "interpreter.h"using namespace std;//////double sinc(double x){ return ((x == 0) ? 1.0 : sin(x)/x);}//////void LoadAdvMath(ItemList & list){ list.Add(new Operation(ERF, "erf", 1)); list.Add(new Operation(ERFC, "erfc", 1)); list.Add(new Operation(GAMMA, "gamma", 1)); list.Add(new Operation(SIGMOID, "sigmoid", 1)); list.Add(new Operation(J0, "j0", 1)); list.Add(new Operation(J1, "j1", 1)); list.Add(new Operation(Y0, "y0", 1)); list.Add(new Operation(Y1, "y1", 1)); list.Add(new Operation(SINC, "sinc", 1)); list.Add(new Operation(HYPOT, "hypot", 2)); list.Add(new Operation(JN, "jn", 2)); list.Add(new Operation(YN, "yn", 2)); // Alias list.Add(new Operation(J0, "bessel0", 1)); list.Add(new Operation(J1, "bessel1", 1)); list.Add(new Operation(Y0, "sbessel0", 1)); list.Add(new Operation(Y1, "sbessel1", 1)); list.Add(new Operation(JN, "bessel", 2)); list.Add(new Operation(YN, "sbessel", 2));}//////void AdvancedMathHelp(){ cout << endl << "Advanced Mathematical functions: " << endl << endl; cout << " rand Random number between 0 and 1." << endl; cout << " hypot Euclidean distance." << endl; cout << " gamma Gamma function." << endl; cout << " erf Error function." << endl; cout << " erfc Complementary erf." << endl; cout << " sigmoid Logistic (sigmoid) function." << endl; cout << " j0 zero-order Bessel function, 1st kind." << endl; cout << " j1 first-order Bessel function, 1st kind." << endl; cout << " jn nth-order Bessel function, 1st kind." << endl; cout << " y0 zero-order Bessel function, 2nd kind." << endl; cout << " y1 first-order Bessel function, 2nd kind." << endl; cout << " yn nth-order Bessel function, 2nd kind." << endl; cout << " sinc Sinc function." << endl;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -