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

increasing precision of mpc produces nan #65

Closed
ofloveandhate opened this issue Aug 13, 2018 · 2 comments
Closed

increasing precision of mpc produces nan #65

ofloveandhate opened this issue Aug 13, 2018 · 2 comments

Comments

@ofloveandhate
Copy link

making a complex number, then increasing its precision, produces (nan,nan). test below.

// doesn't fail
BOOST_AUTO_TEST_CASE(real_precision_increase)
{
	DefaultPrecision(50);
	mpfr_float a(2);
	a.precision(100);
	std::cout << a << '\n';  // just 2
	BOOST_CHECK(abs(mpfr_float(2)-a) < 1e-50);
}

//fails
BOOST_AUTO_TEST_CASE(complex_precision_increase)
{
	DefaultPrecision(50);
	mpfr_complex a(2,3);
	a.precision(100);
	std::cout << a << '\n';  // (nan,nan) for me...
	BOOST_CHECK(abs(mpfr_complex(2,3)-a) < 1e-50);
}
jzmaddock added a commit that referenced this issue Aug 15, 2018
Correct expected test result on assignment to variable of differing precision.
See #65.
@jzmaddock
Copy link
Collaborator

Confirmed, should be fixed in develop.

@jzmaddock
Copy link
Collaborator

CI passing, closing.

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

2 participants