Skip to content

Return type of * for x::Gray{Bool} and real number #148

@kimikage

Description

@kimikage

I haven't made up my mind about what the return type should be if the definition of one for Colorant types is the real number 1. (cf. JuliaGraphics/ColorTypes.jl#235)
I found an odd type promotion in the case study.

julia> Gray{N0f8}(1) * 1
Gray{Float32}(1.0f0)

julia> Gray{N0f8}(1) * true
Gray{N0f8}(1.0)

julia> Gray{N0f8}(1) * 1N0f8
Gray{N0f8}(1.0)
julia> Gray{Bool}(1) * 1 # !?
Gray{BigFloat}(1.0)

julia> Gray{Bool}(1) * true # !?
Gray{Float32}(1.0f0)

julia> Gray{Bool}(1) * 1N0f8
Gray{N0f8}(1.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions