Skip to content

convert(::Type{BigFloat}, ...) uses the current rounding mode, shouldn't it instead always use RoundNearest? #55924

Open

Description

julia> setprecision(BigFloat, 4) do
           (
               setrounding(BigFloat, RoundDown) do
                   convert(BigFloat, 1/3)
               end,
               setrounding(BigFloat, RoundUp) do
                   convert(BigFloat, 1/3)
               end,
           )
       end
(0.312, 0.344)

julia> ==(ans...)
false

I think it'd make more sense for convert(::Type{BigFloat}, ::Any) not to depend on the current rounding mode. It could always use RoundNearest, no? Would that be a breaking change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    bignumsBigInt and BigFloatneeds decisionA decision on this change is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions