Skip to content
This repository has been archived by the owner on Feb 1, 2020. It is now read-only.

LukasBanana/Abacus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Abacus - Simple mathematical expression parser with calculator interface and arbitrary precision

License

3-Clause BSD License

Status

Beta

Dependencies

Arbitrary Precision Package see http://www.hvks.com/Numerical/arbitrary_precision.html

Example

#include <Abacus/Abacus.h>
#include <iostream>

class Log : public Ac::Log
{
public:
    void Error(const std::string& s) override
    {
        std::cerr << s << std::endl;
    }
};

int main()
{
    Log log;
    Ac::ConstantsSet constantsSet;
    Ac::ComputeMode computeMode;
    
    Ac::SetFloatPrecision(50);
    
    std::cout << Ac::Compute("x = 12", computeMode, constantsSet, &log) << std::endl;
    std::cout << Ac::Compute("3 + 2*(pi^-e - sqrt(log2(x*5)))", computeMode, constantsSet, &log) << std::endl;

    return 0;
}

About

Simple mathematical expression parser with calculator interface and arbitrary precision

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages