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

Incorrect product sign for negative values #26

Open
louiev opened this issue Jun 13, 2018 · 0 comments
Open

Incorrect product sign for negative values #26

louiev opened this issue Jun 13, 2018 · 0 comments
Labels

Comments

@louiev
Copy link

louiev commented Jun 13, 2018

typedef long double ldbl;

const int imax = numeric_limits< int >::min();
ldbl xdbl = pow(static_cast< ldbl >(imax), 5);
Dodecahedron::Bigint ibig = imax;
Dodecahedron::Bigint xbig = ibig.pow(5);

imax = -2147483648
xdbl = -4.56719e+046
xbig = 45671926166590716193865151022383844364247891968

The sign is incorrect for xbig.

The same incorrect result is obtained with
Dodecahedron::Bigint xbig = ibig * ibig * ibig * ibig * ibig;

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

No branches or pull requests

2 participants