11 Jan
2017
11 Jan
'17
8:30 p.m.
Hello, I wrote some program to do some calculations with GiNaC. But I can see program makes some unwanted transformations of expressions automatically. Below is simple example. Can I avoid that transformations? Wanted output is sqrt(m/2). Best regards Petrov A.B. -------------------------------------------------------------------- Output for program: Starting: ./test2 1/2*sqrt(2)*sqrt(m) *** Exited normally *** ------------------------------------------------------------------ Program: #include <iostream> using namespace std; #include<ginac/ginac.h> using namespace GiNaC; void calc_example(){ possymbol m("m"); ex e = sqrt(m/2); cout << e << endl; } int main(int argc, char** argv) { calc_example(); return 0; }