Skip to content

isinteger(::Normed) incorrect #120

Closed
@cjdoris

Description

@cjdoris

The code currently assumes that the denominator is 2^f, which is not the case for Normed. e.g.

julia> isinteger(Normed{UInt8,7}(1))
false

I believe you need to change

isinteger(x::FixedPoint{T,f}) where {T,f} = (x.i&(1<<f-1)) == 0

to

isinteger(x::Fixed{T,f}) where {T,f} = (x.i&(1<<f-1)) == 0
isinteger(x::Normed{T,f}) where {T,f} = (x.i%(1<<f-1)) == 0

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