1
0
mirror of https://github.com/aportelli/LatAnalyze.git synced 2025-06-22 00:42:02 +01:00

general cleaning/consolidation of the math interpreter

This commit is contained in:
2014-02-06 18:07:27 +00:00
parent 50d21ae904
commit ce6469cdd7
14 changed files with 1067 additions and 57 deletions

View File

@ -0,0 +1,31 @@
#include <iostream>
#include <iomanip>
#include <latan/CompiledFunction.hpp>
using namespace std;
using namespace Latan;
int main(int argc, char* argv[])
{
string source;
if (argc != 2)
{
cerr << "usage: " << argv[0] << " <function>" << endl;
return EXIT_FAILURE;
}
source = argv[1];
CompiledDoubleFunction f(1, source);
cout << "-- Program:" << endl << f << endl;
cout << "-- Values:" << endl;
for (double x = 0.0; x < 10.0; x += 0.5)
{
cout << "f(" << right << setw(6) << strFrom<double>(x) << ")= "
<< f(x) << endl;
}
return EXIT_SUCCESS;
}