Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to CML file #21

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 1 addition & 3 deletions include/real/real_math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,9 +360,7 @@ namespace boost{
else
result -= cur_term;

for(exact_number<T> i = (two * term_number) + literals::one_exact<T> ; i <= two * (term_number + literals::one_exact<T>); i = i + literals::one_exact<T>){
factorial *= i;
}
factorial *=((two * term_number) + literals::one_exact<T>)*(two * (term_number + literals::one_exact<T>));
cur_power *= square_x;
cur_term = cur_power;
++ term_number_int;
Expand Down