Skip to content
Merged
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
2 changes: 1 addition & 1 deletion doc/modules/ROOT/examples
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/basics.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ The entire library can be accessed using the convenience header `<boost/decimal.
A short example of the basic usage:

[#first_example]
.This https://github.com/boostorg/decimal/blob/develop/examples/first_example.cpp[example] shows the very basics on how to make a complete and working program using the decimal library
.This https://github.com/boostorg/decimal/blob/develop/example/first_example.cpp[example] shows the very basics on how to make a complete and working program using the decimal library
====
[source, c++]
----
Expand Down
4 changes: 2 additions & 2 deletions doc/modules/ROOT/pages/cfenv.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ IMPORTANT: Much like `std::fesetround`, `boost::decimal::fesetround` is not thre

[#examples_rounding_mode]

.This https://github.com/boostorg/decimal/blob/develop/examples/rounding_mode.cpp[example] demonstrates how to set, get, and effects of the global rounding mode.
.This https://github.com/boostorg/decimal/blob/develop/example/rounding_mode.cpp[example] demonstrates how to set, get, and effects of the global rounding mode.
====
[source, c++]
----
Expand Down Expand Up @@ -102,7 +102,7 @@ This same example can be reduced for the cases where:

2. You want to change the compile time rounding mode

.This https://github.com/boostorg/decimal/blob/develop/examples/rounding_mode.cpp[example] demonstrates how the compile time rounding mode can be set, and it's effects on compile time and run time evaluation.
.This https://github.com/boostorg/decimal/blob/develop/example/rounding_mode.cpp[example] demonstrates how the compile time rounding mode can be set, and it's effects on compile time and run time evaluation.
====
[source, c++]
----
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/cohorts.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Below is an example of how cohorts can be preserved if one so wishes.

== Cohort Preserving `<charconv>` Example

This example can be found in the `examples/` folder as https://github.com/boostorg/decimal/blob/develop/examples/charconv_cohort_preservation.cpp[charconv_cohort_preservation.cpp].
This example can be found in the `example/` folder as https://github.com/boostorg/decimal/blob/develop/example/charconv_cohort_preservation.cpp[charconv_cohort_preservation.cpp].

[source, c++]
----
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/conversions.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ constexpr T from_dpd(unsigned __int128 bits) noexcept;

== Bit Conversions Example

The following example is copied and pasted from the examples/ folder of the library and is called https://github.com/boostorg/decimal/blob/develop/examples/bit_conversions.cpp[bit_conversions.cpp].
The following example is copied and pasted from the example/ folder of the library and is called https://github.com/boostorg/decimal/blob/develop/example/bit_conversions.cpp[bit_conversions.cpp].

[source, c++]
----
Expand Down
26 changes: 13 additions & 13 deletions doc/modules/ROOT/pages/examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ https://www.boost.org/LICENSE_1_0.txt
:idprefix: examples_

The following examples will help you get up and running with many of the major parts of the library.
All of these examples can be found in the library `examples/` folder as well.
All of these examples can be found in the library `example/` folder as well.

[#examples_construction]
== Basic Construction
.This https://github.com/boostorg/decimal/blob/develop/examples/basic_construction.cpp[example] demonstrates the basic use of the various constructors offered by the decimal types
.This https://github.com/boostorg/decimal/blob/develop/example/basic_construction.cpp[example] demonstrates the basic use of the various constructors offered by the decimal types
====
[source, c++]
----
Expand All @@ -36,7 +36,7 @@ Can not construct from invalid string
[#examples_basic_math]
== Basic Arithmetic

.This https://github.com/boostorg/decimal/blob/develop/examples/basic_arithmetic.cpp[example] demonstrates the behavior and functionality of arithmetic using a single type
.This https://github.com/boostorg/decimal/blob/develop/example/basic_arithmetic.cpp[example] demonstrates the behavior and functionality of arithmetic using a single type
====
[source, c++]
----
Expand All @@ -55,7 +55,7 @@ Wolfram Alpha sqrt(2): 1.414213562373095
====

[#examples_math_results]
.This https://github.com/boostorg/decimal/blob/develop/examples/addition.cpp[example] shows the differences in arithmetic results between decimal floating point and binary floating point
.This https://github.com/boostorg/decimal/blob/develop/example/addition.cpp[example] shows the differences in arithmetic results between decimal floating point and binary floating point
====
[source,c++]
----
Expand All @@ -75,7 +75,7 @@ Decimal Result: 100
[#examples_integer_conversions]
=== Integral Conversions

.This https://github.com/boostorg/decimal/blob/develop/examples/integral_conversions.cpp[example] shows how to construct an integral value from decimal type and vice versa, as well as the behavior
.This https://github.com/boostorg/decimal/blob/develop/example/integral_conversions.cpp[example] shows how to construct an integral value from decimal type and vice versa, as well as the behavior

====
[source, c++]
Expand Down Expand Up @@ -107,7 +107,7 @@ decimal32_t from max: 1.844674e+19
[#examples_binary_floating_conversions]
=== Binary Floating Point Conversions

.This https://github.com/boostorg/decimal/blob/develop/examples/binary_float_conversions.cpp[example] shows how to construct a binary floating point value from decimal type and vice versa, as well as the behavior
.This https://github.com/boostorg/decimal/blob/develop/example/binary_float_conversions.cpp[example] shows how to construct a binary floating point value from decimal type and vice versa, as well as the behavior
====
[source,c++]
----
Expand All @@ -128,7 +128,7 @@ decimal32_t pi: 3.141593
[#examples_promotion]
== Promotion and Mixed Decimal Arithmetic

.This https://github.com/boostorg/decimal/blob/develop/examples/promotion.cpp[example] demonstrates the behaviors of promotion between types, and mixed decimal type arithmetic
.This https://github.com/boostorg/decimal/blob/develop/example/promotion.cpp[example] demonstrates the behaviors of promotion between types, and mixed decimal type arithmetic
====
[source, c++]
----
Expand All @@ -151,7 +151,7 @@ The result of 2*c is a decimal64_t: 18.2
[#examples_charconv]
== `<charconv>`

.This https://github.com/boostorg/decimal/blob/develop/examples/charconv.cpp[example] demonstrates the fundamentals of the `<charconv>` like functions provided by the library
.This https://github.com/boostorg/decimal/blob/develop/example/charconv.cpp[example] demonstrates the fundamentals of the `<charconv>` like functions provided by the library
====
[source, c++]
----
Expand All @@ -169,7 +169,7 @@ Value in scientific format with precision 20: -7.12345000000000000000e+06

[#examples_generic_programming]
== Generic Programming
.This https://github.com/boostorg/decimal/blob/develop/examples/adl.cpp[example] demonstrates how to write generic code that accepts both built-in floating point types, and decimal floating point values from this library
.This https://github.com/boostorg/decimal/blob/develop/example/adl.cpp[example] demonstrates how to write generic code that accepts both built-in floating point types, and decimal floating point values from this library
====
[source, c++]
----
Expand Down Expand Up @@ -206,7 +206,7 @@ sin(-0.5) = -0.479426

[#examples_literals_constants]
== Literals and Constants
.This https://github.com/boostorg/decimal/blob/develop/examples/literals.cpp[example] demonstrates how to construct values using literals, and the usage of numerical constants that are provided by the library
.This https://github.com/boostorg/decimal/blob/develop/example/literals.cpp[example] demonstrates how to construct values using literals, and the usage of numerical constants that are provided by the library
====
[source, c++]
----
Expand All @@ -233,7 +233,7 @@ pass:[{fmt}] support is available starting with pass:[C++14] so long as you have
[#examples_fmt_format]
=== `<fmt/format.hpp>`

.This https://github.com/boostorg/decimal/blob/develop/examples/fmt_format.cpp[example] demonstrates the various formatting options provided by the library to support usage of pass:[{fmt}]
.This https://github.com/boostorg/decimal/blob/develop/example/fmt_format.cpp[example] demonstrates the various formatting options provided by the library to support usage of pass:[{fmt}]
====
[source, c++]
----
Expand Down Expand Up @@ -339,7 +339,7 @@ You must include it yourself.

Taking the above example of pass:[{fmt}] and replacing all instances of `namespace fmt` with `namespace std` gives us another working example.

.This https://github.com/boostorg/decimal/blob/develop/examples/format.cpp[example] demonstrates how to use `<format>` with the library in-place or in addition to pass:[{fmt}]
.This https://github.com/boostorg/decimal/blob/develop/example/format.cpp[example] demonstrates how to use `<format>` with the library in-place or in addition to pass:[{fmt}]
====
[source, c++]
----
Expand Down Expand Up @@ -383,7 +383,7 @@ Combined Format Specifiers:

[#examples_print]
=== `<print>`
.This https://github.com/boostorg/decimal/blob/develop/examples/print.cpp[example] demonstrates how to use `<print>` with the library
.This https://github.com/boostorg/decimal/blob/develop/example/print.cpp[example] demonstrates how to use `<print>` with the library
====
[source, c++]
----
Expand Down
6 changes: 3 additions & 3 deletions doc/modules/ROOT/pages/financial_examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ https://www.boost.org/LICENSE_1_0.txt
:idprefix: financial_examples_

Below are a few additional examples as to how the Decimal library can be used in the context of financial applications.
All of these examples can be found in the library `examples/` folder as well.
All of these examples can be found in the library `example/` folder as well.

== Parsing Pricing Data from File
[#examples_money_parsing]
.This https://github.com/boostorg/decimal/blob/develop/examples/numerical_parsing.cpp[example] demonstrates the numerical differences between parsing of monetary values between using `decimal32_t` and `float`
.This https://github.com/boostorg/decimal/blob/develop/example/numerical_parsing.cpp[example] demonstrates the numerical differences between parsing of monetary values between using `decimal32_t` and `float`
====
[source, c++]
----
Expand All @@ -31,7 +31,7 @@ Sum using decimal32_t: 52151.99

[#examples_boost_math]
== Boost.Math to Calculate Bollinger Bands
.This https://github.com/boostorg/decimal/blob/develop/examples/statistics.cpp[example] demonstrates how we can use the decimal library with existing Boost.Math facilities to perform statistical analysis
.This https://github.com/boostorg/decimal/blob/develop/example/statistics.cpp[example] demonstrates how we can use the decimal library with existing Boost.Math facilities to perform statistical analysis
====
[source, c++]
----
Expand Down
2 changes: 1 addition & 1 deletion doc/modules/ROOT/pages/format.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ String literal pass:["{Sign, Padding, Precision, Type, Locale}"]

== Examples

This example can be found in the examples/ folder as https://github.com/boostorg/decimal/blob/develop/examples/fmt_format.cpp[fmt_format.cpp]
This example can be found in the example/ folder as https://github.com/boostorg/decimal/blob/develop/example/fmt_format.cpp[fmt_format.cpp]

The header `<boost/decimal/fmt_format.hpp>` is *NOT* part of the convenience header, because it is an optional dependency on a potentially compiled library.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions examples/where_file.hpp → example/where_file.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string
// in order to find out where it is located.

// Boost-root
std::string test_vectors_filename_relative = "libs/decimal/examples/" + test_vectors_filename;
std::string test_vectors_filename_relative = "libs/decimal/example/" + test_vectors_filename;

std::ifstream in_01(test_vectors_filename_relative.c_str());

Expand All @@ -33,7 +33,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string
else
{
// Local test directory or IDE
test_vectors_filename_relative = "../examples/" + test_vectors_filename;
test_vectors_filename_relative = "../example/" + test_vectors_filename;

std::ifstream in_02(test_vectors_filename_relative.c_str());

Expand All @@ -46,7 +46,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string
else
{
// test/cover
test_vectors_filename_relative = "../../examples/" + test_vectors_filename;
test_vectors_filename_relative = "../../example/" + test_vectors_filename;

std::ifstream in_03(test_vectors_filename_relative.c_str());

Expand All @@ -59,7 +59,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string
else
{
// CMake builds
test_vectors_filename_relative = "../../../../libs/decimal/examples/" + test_vectors_filename;
test_vectors_filename_relative = "../../../../libs/decimal/example/" + test_vectors_filename;

std::ifstream in_04(test_vectors_filename_relative.c_str());

Expand All @@ -85,7 +85,7 @@ inline auto where_file(const std::string& test_vectors_filename) -> std::string
else
{
// Clion Cmake builds
test_vectors_filename_relative = "../../../libs/decimal/examples/" + test_vectors_filename;
test_vectors_filename_relative = "../../../libs/decimal/example/" + test_vectors_filename;

std::ifstream in_06(test_vectors_filename_relative.c_str());

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
42 changes: 21 additions & 21 deletions test/Jamfile
Original file line number Diff line number Diff line change
Expand Up @@ -213,27 +213,27 @@ run test_zeta.cpp ;
run limits_link_1.cpp limits_link_2.cpp limits_link_3.cpp ;

# Run the examples too
run ../examples/adl.cpp ;
run ../examples/basic_construction.cpp ;
run ../examples/bit_conversions.cpp ;
run ../examples/charconv.cpp ;
run ../examples/charconv_cohort_preservation.cpp ;
run ../examples/literals.cpp ;
run ../examples/rounding_mode.cpp ;
run ../examples/rounding_mode_compile_time.cpp ;
run ../examples/statistics.cpp ;
run ../examples/format.cpp ;
run ../examples/fmt_format.cpp ;
run ../examples/print.cpp ;
run ../examples/promotion.cpp ;
run ../examples/numerical_parsing.cpp ;
run ../examples/first_example.cpp ;
run ../examples/basic_arithmetic.cpp ;
run ../examples/to_from_file.cpp ;
run ../examples/addition.cpp ;
run ../examples/debugger.cpp ;
run ../examples/binary_float_conversions.cpp ;
run ../examples/integral_conversions.cpp ;
run ../example/adl.cpp ;
run ../example/basic_construction.cpp ;
run ../example/bit_conversions.cpp ;
run ../example/charconv.cpp ;
run ../example/charconv_cohort_preservation.cpp ;
run ../example/literals.cpp ;
run ../example/rounding_mode.cpp ;
run ../example/rounding_mode_compile_time.cpp ;
run ../example/statistics.cpp ;
run ../example/format.cpp ;
run ../example/fmt_format.cpp ;
run ../example/print.cpp ;
run ../example/promotion.cpp ;
run ../example/numerical_parsing.cpp ;
run ../example/first_example.cpp ;
run ../example/basic_arithmetic.cpp ;
run ../example/to_from_file.cpp ;
run ../example/addition.cpp ;
run ../example/debugger.cpp ;
run ../example/binary_float_conversions.cpp ;
run ../example/integral_conversions.cpp ;

# Test compilation of separate headers
compile compile_tests/bid_conversion.cpp ;
Expand Down
20 changes: 0 additions & 20 deletions test/cmake_subdir_test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,6 @@ project(cmake_subdir_test LANGUAGES CXX)

add_subdirectory(../.. boostorg/decimal)

set(deps

# Primary dependencies

assert
config
core

# Secondary dependencies

static_assert
throw_exception
)

foreach(dep IN LISTS deps)

add_subdirectory(../../../${dep} boostorg/${dep})

endforeach()

add_executable(quick ../quick.cpp)
target_link_libraries(quick Boost::decimal)

Expand Down
Loading