Skip to content

[RFC] Changing the promotion type of Integer and Fixed to a float type. #192

@kimikage

Description

@kimikage

I was considering introducing checked_mul for Issue #78. However, I noticed that there are differences in promotion rules between Fixed and Normed.

julia> 2 * 0.5N2f14 # promotion to Float32
1.000061f0

julia> 2 * 0.5Q1f14 # promotion to Q1f14 (issue #78)
ERROR: ArgumentError: Fixed{Int16,14} is a 16-bit type representing 65536 values from -2.0 to 1.99994; cannot represent 2

Perhaps this is due to the current (historical) implementation where Fixed is signed and Normed is unsigned, but IMO, it seems practical to promote them to float types, and not to add ::Integer * ::FixedPoint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breakingMajor breaking change

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions