Steppable 0.0.1
A CAS project written from scratch in C++
|
Steppable has an API in C++ and Python.
You may use the API by adding a new component.
To add a new feature, a
:
src/a
in the Steppable directory, with at least three files:a.cpp
- The main file. The main
function should be present, as it is the entry point of the executable.aReport.cpp
- The report file to show the results.aReport.hpp
- A header that contains optional definition.Add an entry to CMakeLists.txt
at the root of the repository.
You may include the Steppable header files. They are:
argParse.hpp
- Argument parsing for executables.colors.hpp
- Printing with colors, or with custom formats.exceptions.hpp
- Exceptions to throw in case of error.fn/basicArithm.hpp
- Basic arithmetics.format.hpp
- String formatting.fraction.hpp
- Fractions in Steppable.logging.hpp
- Log file creation and management.number.hpp
- Numbers in Steppable.output.hpp
- Console logging utilities.platform.hpp
- Platform-specific functions.rounding.hpp
- Round off numbers.symbols.hpp
- Mathematical symbols.testing.hpp
- Unit testing utilities.util.hpp
- Useful utilities for string manipulation, numbers, etc.The symbols are sometimes inside namespaces. They are:
namespace steppable::__internals::arithmetic
- Arithmetic functions.namespace steppable::__internals::format
- Text formatting.namespace steppable::__internals::logging
- Log file creation and management.namespace steppable::__internals::numUtils
- Number manipulation utilities.namespace steppable::__internals::stringUtils
- String manipulation utilities.namespace steppable::__internals::symbols
- Mathematical symbols.namespace steppable::__internals::utils
- Utility functions.namespace steppable::exceptions
- Exceptions.namespace steppable::output
- Console logging utilities.namespace steppable::testing
- Unit testing utilities.namespace steppable
- Root namespace. Public Methods are here.In namespace steppable
, there are two classes, and one enum
.
class Number
- Steppable number. It can be added, subtracted, multiplied, divided, etc. For more information, see the documentation for this.class Fraction
- Steppable fraction. It also supports multiply arithmetic operators. For more information, see the documentation for this.enum RoundingMode
- Specifies how the result should be rounded.In namespace steppable::__internals::arithmetic
, there is one class and several methods.
struct QuotientRemainder
- A struct
representing the result and remainder from a division operation. For more information, see the documentation for this.The Python library is created using nanobind. You need to create the library on the same platform and using the same version of Python.
You may import the library as follows:
There are three available classes.
class Number
- Steppable number. It can be added, subtracted, multiplied, divided, etc. Operators are overloaded, same as in C++.class Fraction
- Steppable fraction. It also supports multiply arithmetic operators. Operators are overloaded, same as in C++.enum RoundingMode
- Specifies how the result should be rounded.