Skip to content

rounding(::Type{Float16}) #55926

@nsajko

Description

@nsajko
Contributor

On my system, which doesn't have native Float16, the method for rounding(Float16) doesn't exist. As far as I see effectively the rounding mode is RoundNearest, no? So I guess the method should be defined and it should return RoundNearest.

Activity

giordano

giordano commented on Sep 29, 2024

@giordano
Member

On my system, which doesn't have native Float16

I don't think having native hardware support for Float16 is relevant here, since I get

julia> rounding(Float16)
ERROR: MethodError: no method matching rounding(::Type{Float16})
The function `rounding` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  rounding(::Type{BigFloat})
   @ Base mpfr.jl:169
  rounding(::Type{T}) where T<:Union{Float32, Float64}
   @ Base rounding.jl:222

also on Apple Silicon. And in general I think we should treat Float16 as first-class floating point type, and not as an exception (related to #53745)

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

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @giordano@nsajko

        Issue actions

          `rounding(::Type{Float16})` · Issue #55926 · JuliaLang/julia