Skip to content

Commit

Permalink
Constexpr next (#789)
Browse files Browse the repository at this point in the history
Implements constexpr: nextafter, nextafterf, nextafterl, nexttoward, nexttowardf, and nexttowardl as described in P0533R9
  • Loading branch information
mborland authored Jun 29, 2022
1 parent 4ffe9bb commit ae0fe3d
Show file tree
Hide file tree
Showing 7 changed files with 565 additions and 2 deletions.
10 changes: 8 additions & 2 deletions doc/sf/ccmath.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)

[heading Description]

`Constexpr` implementations of the functionality found in `<cmath>`.
`Constexpr` implementations of the functionality found in `<cmath>` and `<cstdlib>` [@https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2021/p0533r9.pdf proposed for C++23].
In a `constexpr` context the functions will use an implementation defined in boost.
If the context is not `constexpr` the functionality will be directly from the STL implementation of `<cmath>` used by the compiler.
All functions that take an `Integer` type and return a `double` simply cast the `Integer` argument to a `double`.
Expand Down Expand Up @@ -187,7 +187,13 @@ All of the following functions require C++17 or greater.
Requires compiling with fma flag

template <typename Arithmetic1, typename Arithmetic2, typename Arithmetic3>
inline constepxr Promoted fma(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z) noexcept
inline constexpr Promoted fma(Arithmetic1 x, Arithmetic2 y, Arithmetic3 z) noexcept

template <typename Arithmetic1, typename Arithmetic2>
constexpr Promoted nextafter(Arithmetic1 from, Arithmetic2 to)

template <typename T>
constexpr Promoted nexttoward(T from, long double to)

} // Namespaces

Expand Down
Loading

0 comments on commit ae0fe3d

Please sign in to comment.