# Round methods for Complex

**URL:** <https://discourse.julialang.org/t/round-methods-for-complex/6260>\
**Category:** Internals & Design\
**Created:** [October 5, 2017, 8:29am UTC](https://discourse.julialang.org/t/round-methods-for-complex/6260 "2017-10-05T08:29:29Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethomag](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ethomag/32/421_2.png) [@ethomag](https://discourse.julialang.org/u/ethomag)\
**Post date:** [October 5, 2017, 8:29am UTC](https://discourse.julialang.org/t/round-methods-for-complex/6260/1 "2017-10-05T08:29:30Z")

</div>

To me it seems that there are some round methods missing in Base

```
julia> round(Complex64, Complex(0, 1.0))
ERROR: MethodError: no method matching round(::Type{Complex{Float32}}, ::Complex{Float64})

```

Shouldn’t there be something like ?

```
round(::Type{Complex{T}}, x::Complex{U}) where U<:Real where T<:Real = Complex{T}(round(T, x.re), round(T, x.im))

```

I am running julia 0.6

---

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [October 5, 2017, 8:50am UTC](https://discourse.julialang.org/t/round-methods-for-complex/6260/2 "2017-10-05T08:50:38Z")

</div>

This isn’t specific to `Complex`:

```julia
julia> round(Float32, 1.0)
ERROR: MethodError: no method matching round(::Type{Float32}, ::Float64)
Closest candidates are:
  round(::Type{T<:Integer}, ::AbstractFloat) where T<:Integer at float.jl:337
  round(::Type{T}, ::Rational{Bool}) where T at rational.jl:403
  round(::Type{T}, ::Rational{Bool}, ::RoundingMode{:Nearest}) where T at rational.jl:409
  ...

julia> round(Float64, 1.0)
ERROR: MethodError: no method matching round(::Type{Float64}, ::Float64)
Closest candidates are:
  round(::Type{T<:Integer}, ::AbstractFloat) where T<:Integer at float.jl:337
  round(::Type{T}, ::Rational{Bool}) where T at rational.jl:403
  round(::Type{T}, ::Rational{Bool}, ::RoundingMode{:Nearest}) where T at rational.jl:409
  ...

```

---

<div class="post-metadata">

**Author:** ![StefanKarpinski](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stefankarpinski/32/24_2.png) [@StefanKarpinski](https://discourse.julialang.org/u/StefanKarpinski)\
**Post date:** [October 5, 2017, 2:18pm UTC](https://discourse.julialang.org/t/round-methods-for-complex/6260/3 "2017-10-05T14:18:31Z")

</div>

Could definitely use an issue for a feature request.
