Skip to content

MSB may be cleared in conversion from BigFloat on ARM #202

Description

@kimikage
julia> BigFloat(typemax(UInt64))|>N63f1 # x86-64 / i686 
1.8446744073709552e19N63f1 

julia> BigFloat(typemax(UInt64))|>N63f1 # Aarch64 / ARMv7
9.223372036854776e18N63f1

Originally posted by @kimikage in #200 (comment)

The following workaround is harmful to BigFloat.

# a workaround for 32-bit ARMv7 (issue #134)
function _unsafe_trunc(::Type{T}, x::AbstractFloat) where {T}
unsafe_trunc(T, unsafe_trunc(typeof(signed(zero(T))), x))
end

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions