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

Unable to make BigFloat with different precision #20766

Closed
dpsanders opened this issue Feb 23, 2017 · 4 comments
Closed

Unable to make BigFloat with different precision #20766

dpsanders opened this issue Feb 23, 2017 · 4 comments
Labels
domain:bignums BigInt and BigFloat domain:maths Mathematical functions kind:bug Indicates an unexpected problem or unintended behavior

Comments

@dpsanders
Copy link
Contributor

dpsanders commented Feb 23, 2017

julia> x = big"1.0";

julia> precision(x)
256

julia> y = BigFloat(x, 100);

julia> precision(y)
256

This should make a BigFloat with precision 100.

@StefanKarpinski StefanKarpinski added the kind:bug Indicates an unexpected problem or unintended behavior label Feb 23, 2017
@ararslan ararslan added the domain:maths Mathematical functions label Feb 23, 2017
@simonbyrne
Copy link
Contributor

So the question is: should BigFloat(x::BigFloat) be able to give a result with different precision than x? What about convert(::Type{BigFloat}, x::BigFloat)?

@dpsanders
Copy link
Contributor Author

I seem to have missed your comment, sorry.

I would say that following through the current policy of having a global precision for BigFloat construction means that indeed BigFloat(x::BigFloat) should convert x to a BigFloat with the current global precision.

I do see that convert(::Type{BigFloat}, x::BigFloat) is questionable, though...

@StefanKarpinski
Copy link
Sponsor Member

Yet again, I find myself feeling that BigFloat should have a precision parameter.

@dpsanders
Copy link
Contributor Author

Yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:bignums BigInt and BigFloat domain:maths Mathematical functions kind:bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

5 participants