Compare commits

..
3 Commits
Author SHA256 Message Date
CupWater feac230fef merge 2026-08-16 15:20:11 +08:00
CupWater 83a75d4e76 Merge remote-tracking branch 'origin/main'
# Conflicts:
#	include/bstl/bstl.hpp
#	src/BigDecimal.cpp
#	src/BigInteger.cpp
2026-08-16 15:02:29 +08:00
CupWater fb2b24bc72 修改bstlint 2026-08-16 15:00:09 +08:00
11 changed files with 48 additions and 38 deletions
+4 -4
View File
@@ -4,8 +4,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# 定义源文件 # 定义源文件
set(BETTERSTL_SOURCES set(BETTERSTL_SOURCES
src/BigInteger.cpp src/big_integer.cpp
src/BigDecimal.cpp) src/big_decimal.cpp)
# 生成静态库 (.a 文件) # 生成静态库 (.a 文件)
add_library(BetterSTL_static STATIC ${BETTERSTL_SOURCES}) add_library(BetterSTL_static STATIC ${BETTERSTL_SOURCES})
@@ -26,12 +26,12 @@ add_library(BetterSTL ALIAS BetterSTL_static)
enable_testing() enable_testing()
add_executable(BigIntegerTests tests/BigIntegerTest.cpp) add_executable(BigIntegerTests tests/big_integer_test.cpp)
target_include_directories(BigIntegerTests PRIVATE include) target_include_directories(BigIntegerTests PRIVATE include)
target_link_libraries(BigIntegerTests PRIVATE BetterSTL_static) target_link_libraries(BigIntegerTests PRIVATE BetterSTL_static)
add_test(NAME BigIntegerTests COMMAND BigIntegerTests) add_test(NAME BigIntegerTests COMMAND BigIntegerTests)
add_executable(BigDecimalTests tests/BigDecimalTest.cpp) add_executable(BigDecimalTests tests/big_decimal_test.cpp)
target_include_directories(BigDecimalTests PRIVATE include) target_include_directories(BigDecimalTests PRIVATE include)
target_link_libraries(BigDecimalTests PRIVATE BetterSTL_static) target_link_libraries(BigDecimalTests PRIVATE BetterSTL_static)
add_test(NAME BigDecimalTests COMMAND BigDecimalTests) add_test(NAME BigDecimalTests COMMAND BigDecimalTests)
-7
View File
@@ -1,7 +0,0 @@
#pragma once
#include<BigDecimal.hpp>
#include<BigInteger.hpp>
#include <bstlint.hpp>
#ifndef BETTERSTL_BSTL_HPP
#define BETTERSTL_BSTL_HPP
#endif //BETTERSTL_BSTL_HPP
@@ -1,11 +1,11 @@
#pragma once #ifndef BETTERSTL_BIG_DECIMAL_H
#define BETTERSTL_BIG_DECIMAL_H
#include <string> #include <string>
#include "BigInteger.hpp" #include <bstl/big_integer.hpp>
namespace bstl { namespace bstl {
class BigDecimal {
class BigDecimal {
public: public:
BigDecimal(); BigDecimal();
BigDecimal(int value); BigDecimal(int value);
@@ -70,3 +70,5 @@ private:
}; };
} // namespace bstl } // namespace bstl
#endif //BETTERSTL_BIG_DECIMAL_H
@@ -1,4 +1,5 @@
#pragma once #ifndef BETTERSTL_BIG_INTEGER_HPP
#define BETTERSTL_BIG_INTEGER_HPP
#include <string> #include <string>
@@ -64,6 +65,6 @@ private:
static std::string divAbs(const std::string& a, const std::string& b); static std::string divAbs(const std::string& a, const std::string& b);
}; };
using BitInteger = BigInteger;
} // namespace bstl } // namespace bstl
#endif //BETTERSTL_BIG_INTEGER_HPP
+7
View File
@@ -0,0 +1,7 @@
#ifndef BETTERSTL_BIG_NUMBERS_HPP
#define BETTERSTL_BIG_NUMBERS_HPP
#include <bstl/biginteger.hpp>
#include <bstl/bigdecimal.hpp>
#endif // BETTERSTL_BIG_NUMBERS_HPP
+8
View File
@@ -0,0 +1,8 @@
#ifndef BETTERSTL_BSTL_HPP
#include<bstl/big_decimal.hpp>
#include<bstl/big_integer.hpp>
#include <bstl/bstlint.hpp>
#define BETTERSTL_BSTL_HPP
#endif //BETTERSTL_BSTL_HPP
@@ -2,7 +2,6 @@
#define BETTERSTL_BSTLINT_HPP #define BETTERSTL_BSTLINT_HPP
#include <cstdint> #include <cstdint>
#include <>
typedef std::int8_t i8; typedef std::int8_t i8;
typedef std::int16_t i16; typedef std::int16_t i16;
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BigDecimal.hpp" #include <bstl/big_decimal.hpp>
#include <stdexcept> #include <stdexcept>
#include <sstream> #include <sstream>
+1 -1
View File
@@ -1,4 +1,4 @@
#include "BigInteger.hpp" #include <bstl/big_integer.hpp>
#include <algorithm> #include <algorithm>
#include <stdexcept> #include <stdexcept>
@@ -1,4 +1,4 @@
#include <BigDecimal.hpp> #include <bstl/big_decimal.hpp>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>
@@ -1,4 +1,4 @@
#include <BigInteger.hpp> #include <bstl/big_integer.hpp>
#include <cassert> #include <cassert>
#include <iostream> #include <iostream>