Skip to content

auto promote to more bits #30

@bjarthur

Description

@bjarthur

suming over an Array{UInt8} automatically promotes to UInt64 to prevent overflow. yet doing so over an Array{Gray{UFixed{UInt8}}} does not. would be nice if these behaved similarly.

julia> using ColorVectorSpace

julia> dUInt8 = rand(UInt8,3,3,3);

julia> typeof(sum(dUInt8, 3))
Array{UInt64,3}

julia> dGreyUInt8 = convert(Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},3}, dUInt8);

julia> typeof(dGreyUInt8)
Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},3}

julia> typeof(sum(dGreyUInt8, 3))
Array{ColorTypes.Gray{FixedPointNumbers.UFixed{UInt8,8}},3}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions