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

Tie-to-even rule is not followed for overload remainder(float128, int) #639

Open
cffk opened this issue Oct 10, 2024 · 0 comments
Open

Tie-to-even rule is not followed for overload remainder(float128, int) #639

cffk opened this issue Oct 10, 2024 · 0 comments

Comments

@cffk
Copy link

cffk commented Oct 10, 2024

Running the following code

#include <iostream>
#include <boost/multiprecision/float128.hpp>

int main() {
  using std::remainder;
  boost::multiprecision::float128 x = 180, d = 360;
  std::cout << remainder(x, 360) << " " << remainder(x, d) << "\n";
}

prints out -180 180. I expected both numbers to be the same and the tie-to-even rule for remainder dictates that 180 is the correct result.

I'm on a Fedora 40 machine with boost version 18.3.0 installed.

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