select mcalc('5+5*2/2') as valu;
select mcalc('5+cos(0)') as valu;
select mcalc('5+pi*2)') as valu;
A MySQL/MariaDB module and plugin to calculate the formula and calculate mathematical expression.
Extend your MySQL server with additional functions
gcc -shared -o mcalc.so mcalc.cc evaluation.c -std=c++11 -fPIC
cd sql
make mcalc.o
CREATE FUNCTION mcalc RETURNS double SONAME "mcalc.so";
DROP FUNCTION mcalc;
It will show path where to put the .so
file:
SHOW VARIABLES LIKE 'plugin_dir';
Tested on: MariaDB 10.3.18
- https://github.com/BaseMax/FirstMysqlUDF
- https://github.com/MariaDB/server
- https://github.com/mysql/mysql-server
- tinyexpr, c calculator, c expression calc (Lewis Van Winkle)
My nickname is Max, Programming language developer, Full-stack programmer. I love computer scientists, researchers, and compilers.
A team includes some programmer, developer, designer, researcher(s) especially Max Base.