diff --git a/CMakeLists.txt b/CMakeLists.txt index e22a2fd..643d2d3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,29 +1,25 @@ cmake_minimum_required(VERSION 3.8) -project(Boost.Real) -set (Boost.Real_VERSION_MAJOR 1) -set (Boost.Real_VERSION_MINOR 0) +set(_version 1.0) +project(Boost.Real VERSION ${_version} LANGUAGES CXX) #Add coverage support to CMAKE in debug mode -IF(CMAKE_BUILD_TYPE MATCHES Debug) +if(CMAKE_BUILD_TYPE MATCHES Debug) message("debug mode adding coverage report tools and flags") list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-modules") include(CodeCoverage) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_DEBUG} -Wall -g -O0 -fsanitize=address -fno-omit-frame-pointer -fprofile-arcs -ftest-coverage") -ENDIF(CMAKE_BUILD_TYPE MATCHES Debug) +endif(CMAKE_BUILD_TYPE MATCHES Debug) +# add Boost.Real as a 'linkable' target +add_library(Boost.Real PUBLIC) # Check for standard to use include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-std=c++17 HAVE_FLAG_STD_CXX17) -if(HAVE_FLAG_STD_CXX17) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic --std=c++17") -else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic --std=c++1z") -endif() +target_compile_features(Boost.Real PUBLIC cxx_std_17) + +include_directories(include external/include) -include_directories(include external/include ${Boost_INCLUDE_DIRS}) -# add Boost.Real as a 'linkable' target -add_library(Boost.Real INTERFACE) #Library Headers add_executable(Boost.Real_headers include) diff --git a/include/real/real_math.hpp b/include/real/real_math.hpp index 15012a7..314a6c2 100755 --- a/include/real/real_math.hpp +++ b/include/real/real_math.hpp @@ -360,9 +360,7 @@ namespace boost{ else result -= cur_term; - for(exact_number i = (two * term_number) + literals::one_exact ; i <= two * (term_number + literals::one_exact); i = i + literals::one_exact){ - factorial *= i; - } + factorial *=((two * term_number) + literals::one_exact)*(two * (term_number + literals::one_exact)); cur_power *= square_x; cur_term = cur_power; ++ term_number_int;