Skip to content

Overflow in N63f1(Float64(typemax(N63f1))) and so on #200

Description

@kimikage

For example:

julia> N63f1(prevfloat(2.0^64))
1.8446744073709548e19N63f1

julia> N63f1(2.0^64)
9.223372036854776e18N63f1

The overflow itself occurs here.

ex != -1 || signbit(signed(yi)) && return typemax(N)
return reinterpret(N, unsafe_trunc(T, yi + yi))

However, this is essentially problem with the typemax.

julia> 2.0^64 > typemax(N63f1) # clearly `2^64` is out of range
true

I already know that we have this kind of problem, and in fact I have added the special handling for the cases of N0f64 and Float16.

I forgot about this issue, but the tests on ARM seem to "correctly" fail in this regard.

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