Skip to content

Commit

Permalink
add README file
Browse files Browse the repository at this point in the history
  • Loading branch information
The-Last-Cookie committed Nov 14, 2020
1 parent 6dafe5d commit 93b59a5
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# StringCalc

## Description

Integers and other data types alike have a specific set of values which they can have. If you want to use bigger numbers than these data types offer, you will need a workaround. Strings can theoretically be infinite (practically they are limited by the maximum available memory space). This C++ library offers the ability to use strings and calculate equations with them as if they were numbers.

At the moment, all implemented functions take positive _integers_ and return the calculated number as a string. The subtraction function will put a negative sign at the start of the string in case the result is negative. The input for all functions needs to be positive.

## Example usage

```cpp
// Addition
std::cout << "5 + 6 = " << StringCalc::add("5", "6") << "\n";

// Subtraction
std::cout << "12 - 7 = " << StringCalc::sub("12", "7") << "\n";

// Multiplication
std::cout << "8 * 11 = " << StringCalc::mult("8", "11") << "\n";

// Division
std::cout << "10 / 5 = " << StringCalc::div("10", "5") << "\n";
```

## Planned features

+ Function for fatorials --> n!
+ Function for power --> base^exponent
+ Functionality for calculation of binary strings (maybe even float and hex, not sure yet)
+ Performance improvements: I want to take another look at the implementation to see if I can optimize some things

# Licence

This project is licensed under the [MIT Licence](https://mit-license.org/). See LICENCE file for more information.

0 comments on commit 93b59a5

Please sign in to comment.