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

boost::math::cstdfloat::detail::float_internal128_t #998

Open
gpeterhoff opened this issue Jun 20, 2023 · 1 comment
Open

boost::math::cstdfloat::detail::float_internal128_t #998

gpeterhoff opened this issue Jun 20, 2023 · 1 comment

Comments

@gpeterhoff
Copy link

Hello,
in boost::math::cstdfloat there are several inconsistencies with __float128/_Quad. Generally these are only available with gcc and intel. Since I don't have an intel compiler myself, you might have to modify this path; for now it should behave like the previous implementations.

types <boost/math/cstdfloat/cstdfloat_types.hpp>
intel https://community.intel.com/t5/Intel-C-Compiler/C-Compiler-128-bit-floating-point/m-p/1216949

  • WINDOWS: float_internal128_t = _quad
  • OTHER: float_internal128_t = __float128

defines/constants <boost/math/cstdfloat/cstdfloat_types.hpp>
gcc

  • the constants from <quadmath.h> or builtins can be used
  • signaling NaN is supported

functions <boost/math/cstdfloat/cstdfloat_cmath.hpp>
modified:

limits <boost/math/cstdfloat/cstdfloat_limits.hpp>
All functions can now be provided constexpr noexcept.

future

  • branch-free isgreater, isgreaterequal, ... I don't understand the BOOST_PREVENT_MACRO_SUBSTITUTION inside the functions, otherwise I could have adjusted that right away.
  • With Matt's boost::charconv the IO functions can be provided more efficiently (operator<<, operator>>, to_string, ...).
  • It might be useful to provide quadmath as a separate sublibrary in boost::math, e.g. to avoid the #define/#undef orgies in <boost/math/cstdfloat/cstdfloat_cmath.hpp>.

cstdfloat_types.hpp.txt
cstdfloat_cmath.hpp.txt
cstdfloat_limits.hpp.txt

thx
Gero

@gpeterhoff
Copy link
Author

spelling error
BOOST_CSTDFLOAT_FLOAT128_QUIET_NAN (instead of BOOST_CSTDFLOAT_FLOAT128_QUIT_NAN)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant