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

Change string output for BigFloat Inf and NaN #19939

Merged
merged 2 commits into from
Feb 13, 2017

Conversation

dpsanders
Copy link
Contributor

@dpsanders dpsanders commented Jan 9, 2017

Currently:

julia> BigFloat(Inf)
inf

After this PR:

julia> BigFloat(Inf)
BigFloat(Inf, 256)

julia> BigFloat(-Inf)
BigFloat(-Inf, 256)

julia> BigFloat(NaN)
BigFloat(NaN, 256)

See #13843 for previous discussion, where it was suggested to differentiate the output for BigFloat(Inf) from Inf (the output for Float64(Inf)).

After #17217, it also makes sense to add the precision in this way.

@@ -919,6 +919,11 @@ end
setprecision(f::Function, precision::Integer) = setprecision(f, BigFloat, precision)

function string(x::BigFloat)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional line intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the style I tend to use, but I can remove it.

@dpsanders
Copy link
Contributor Author

The Appveyor failure seems unrelated.

@kshyatt kshyatt added the domain:display and printing Aesthetics and correctness of printed representations of objects. label Jan 9, 2017
@dpsanders
Copy link
Contributor Author

Bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants