Skip to content

Commit

Permalink
Use fmt header only
Browse files Browse the repository at this point in the history
  • Loading branch information
fintarin committed Apr 28, 2024
1 parent 7d7f792 commit 740d107
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ target_include_directories(

target_link_libraries(
${PROJECT_NAME}
PUBLIC fmt::fmt
PUBLIC fmt::fmt-header-only
cppcoro
MPFR
Boost::multiprecision
Expand Down
4 changes: 3 additions & 1 deletion src/fintamath/numbers/RealFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ catch (const UndefinedException &exc) {
}

Real log(const Real &lhs, const Real &rhs) try {
return ln(rhs) / ln(lhs);
Real divLhs = ln(rhs);
Real divRhs = ln(lhs);
return divLhs / divRhs;
}
catch (const UndefinedException &exc) {
throw UndefinedException(fmt::format(
Expand Down
4 changes: 2 additions & 2 deletions tests/src/numbers/RealFunctionsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -579,11 +579,11 @@ TEST(RealFunctionsTests, logTest) {
EXPECT_THAT(
[] { log(Real("0"), Real("-0")); },
testing::ThrowsMessage<UndefinedException>(
testing::StrEq("log(0.0, -0.0) is undefined (ln(0.0) is undefined (expected argument > 0))")));
testing::StrEq("log(0.0, -0.0) is undefined (ln(-0.0) is undefined (expected argument > 0))")));
EXPECT_THAT(
[] { log(Real("-0"), Real("0")); },
testing::ThrowsMessage<UndefinedException>(
testing::StrEq("log(-0.0, 0.0) is undefined (ln(-0.0) is undefined (expected argument > 0))")));
testing::StrEq("log(-0.0, 0.0) is undefined (ln(0.0) is undefined (expected argument > 0))")));
EXPECT_THAT(
[] { log(Real("-0"), Real("-0")); },
testing::ThrowsMessage<UndefinedException>(
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ set(CMAKE_MODULE_PATH
PARENT_SCOPE)

add_subdirectory(fmt)
suppress_warnings(fmt)
suppress_warnings(fmt-header-only)

add_subdirectory(cppcoro)
suppress_warnings(cppcoro)
Expand Down

0 comments on commit 740d107

Please sign in to comment.