Skip to content

Commit

Permalink
Rename steppable::__internals::arithmetic
Browse files Browse the repository at this point in the history
steppable::__internals::arithmetic -> steppable::__internals::calc
  • Loading branch information
ZCG-coder committed Jan 17, 2025
1 parent 64d2679 commit ca34685
Show file tree
Hide file tree
Showing 41 changed files with 56 additions and 89 deletions.
3 changes: 0 additions & 3 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion include/fn/calc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ using namespace std::literals;
* @namespace steppable::__internals
* @brief The namespace containing internal functions for the Steppable library.
*/
namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
/**
* @brief Represents the quotient and remainder of a division operation.
Expand Down
2 changes: 1 addition & 1 deletion include/fn/root.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <string>

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
/**
* @brief A struct to represent a surd.
Expand Down
30 changes: 0 additions & 30 deletions questions

This file was deleted.

4 changes: 2 additions & 2 deletions src/base/baseConvert/baseConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

using namespace std::literals;
using namespace steppable::__internals::stringUtils;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::symbols;
using namespace steppable::localization;
using namespace steppable::output;
Expand All @@ -62,7 +62,7 @@ namespace steppable::prettyPrint::printers
}
} // namespace steppable::prettyPrint::printers

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
/**
* @brief Represents a number using alphabets and numberals.
Expand Down
4 changes: 2 additions & 2 deletions src/base/decimalConvert/decimalConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ using namespace steppable::__internals::utils;
using namespace steppable::__internals::symbols;
using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
/**
* @brief Converts a numeral character to a number string.
Expand Down
4 changes: 2 additions & 2 deletions src/calc/abs/abs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@
#include <string>

using namespace steppable::__internals::utils;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::localization;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string abs(const std::string& _number, const int steps)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/add/add.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@

using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::symbols;
using namespace steppable::localization;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string add(const std::string& a,
const std::string& b,
Expand Down
4 changes: 2 additions & 2 deletions src/calc/atan2/atan2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@
#include <string>

using namespace std::literals;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::numUtils;
using namespace steppable::localization;
using namespace steppable::output;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string atan2(const std::string& y, const std::string& x, const size_t decimals = 10)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/comparison/comparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@
using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::symbols;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::localization;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string compare(const std::string& _a, const std::string& _b, const int steps)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/division/division.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::stringUtils;
using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
QuotientRemainder getQuotientRemainder(const auto& _currentRemainder, const auto& divisor)
{
Expand Down
2 changes: 1 addition & 1 deletion src/calc/division/divisionReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
using namespace std::literals;
using namespace steppable::__internals::stringUtils;
using namespace steppable::__internals::symbols;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

std::string reportDivision(std::stringstream& tempFormattedAns,
const std::string& temp,
Expand Down
4 changes: 2 additions & 2 deletions src/calc/factorial/factorial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@

using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::symbols;
using namespace steppable::output;
using namespace steppable::localization;
using namespace std::literals;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string factorial(const std::string& _number, const int steps)
{
Expand Down
2 changes: 1 addition & 1 deletion src/calc/factorial/factorialReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <sstream>
#include <string>

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::symbols;

std::string reportFactorial(const std::string& number, const std::string& result, int steps)
Expand Down
2 changes: 1 addition & 1 deletion src/calc/hyp/hyp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using namespace steppable::localization;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::numUtils;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string sinh(const std::string& x, const int decimals)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/log/log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@
#include <cstdlib>
#include <string>

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::utils;
using namespace steppable::localization;
using namespace std::literals;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string _log(const std::string& x, const size_t _decimals)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/multiply/multiply.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::stringUtils;
using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string multiply(const std::string& _a, const std::string& _b, const int steps)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/power/power.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
using namespace steppable::__internals::numUtils;
using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

namespace steppable::prettyPrint::printers
{
Expand All @@ -57,7 +57,7 @@ namespace steppable::prettyPrint::printers
}
} // namespace steppable::prettyPrint::printers

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string power(const std::string& _number, const std::string& _raiseTo, const int steps)
{
Expand Down
2 changes: 1 addition & 1 deletion src/calc/power/powerReport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::prettyPrint;
using namespace steppable::__internals::symbols;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

std::string reportPowerRoot(const std::string& _number,
const std::string& raiseTo,
Expand Down
4 changes: 2 additions & 2 deletions src/calc/root/root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
#undef min
#endif

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::stringUtils;
using namespace steppable::__internals::numUtils;
Expand Down Expand Up @@ -87,7 +87,7 @@ namespace steppable::prettyPrint::printers
}
} // namespace steppable::prettyPrint::printers

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string rootIntPart(const std::string& _number, const std::string& base)
{
Expand Down
4 changes: 2 additions & 2 deletions src/calc/subtract/subtract.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
using namespace steppable::__internals::numUtils;
using namespace steppable::output;
using namespace steppable::localization;
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string subtract(const std::string& a, const std::string& b, const int steps, const bool noMinus)
{
Expand Down
2 changes: 1 addition & 1 deletion src/calc/trig/trig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ using namespace steppable::localization;
using namespace steppable::__internals::utils;
using namespace steppable::__internals::numUtils;

namespace steppable::__internals::arithmetic
namespace steppable::__internals::calc
{
std::string degToRad(const std::string& _deg)
{
Expand Down
2 changes: 1 addition & 1 deletion src/calculus/nInt/nInt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#include <string>
#include <vector>

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::numUtils;
using namespace steppable::__internals::utils;
using namespace std::literals;
Expand Down
2 changes: 1 addition & 1 deletion src/factors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <algorithm>
#include <vector>

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::types;

namespace steppable::__internals::numUtils
Expand Down
2 changes: 1 addition & 1 deletion src/fraction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
#undef min
#endif

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;
using namespace steppable::__internals::numUtils;

namespace steppable::prettyPrint::printers
Expand Down
2 changes: 1 addition & 1 deletion src/number.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

namespace steppable
{
using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

Number::Number() : prec(8), value("0") {}

Expand Down
6 changes: 3 additions & 3 deletions src/rounding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace steppable::__internals::numUtils
auto integer = splitNumberResult[0];
auto decimal = splitNumberResult[1]; // Return the integer part
if (decimal.front() > '5')
integer = arithmetic::add(integer, "1", 0);
integer = calc::add(integer, "1", 0);
return integer;
}

Expand All @@ -77,7 +77,7 @@ namespace steppable::__internals::numUtils
// Modify the integer part if the digit is greater than 5
if (decimal.front() >= '5' and digits == 0)
{
integer = arithmetic::add(integer, "1", 0);
integer = calc::add(integer, "1", 0);
return integer;
}
auto newDecimal = decimal.substr(0, digits);
Expand All @@ -94,7 +94,7 @@ namespace steppable::__internals::numUtils
{
newDecimal[i] = '0';
if (i == newDecimal.length() - 1)
integer = arithmetic::add(integer, "1", 0);
integer = calc::add(integer, "1", 0);
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion tests/testAbs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

TEST_START()

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

SECTION(Absolute value with positive number)
const std::string& a = "6453.55";
Expand Down
2 changes: 1 addition & 1 deletion tests/testAdd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

TEST_START()

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

SECTION(Addition with multiple digits of different length)
const std::string& a = "6453.55";
Expand Down
2 changes: 1 addition & 1 deletion tests/testComparison.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

TEST_START()

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

SECTION(Comparison at integer)
const std::string &a = "6453.55";
Expand Down
2 changes: 1 addition & 1 deletion tests/testDecimalConvert.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

TEST_START()

using namespace steppable::__internals::arithmetic;
using namespace steppable::__internals::calc;

SECTION(Decimal Convert without letters)
const std::string &a = "46432231133131";
Expand Down
Loading

0 comments on commit ca34685

Please sign in to comment.