Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement widen() #113

Closed
jmkuhn opened this issue May 5, 2020 · 2 comments · Fixed by #116
Closed

Implement widen() #113

jmkuhn opened this issue May 5, 2020 · 2 comments · Fixed by #116

Comments

@jmkuhn
Copy link
Contributor

jmkuhn commented May 5, 2020

julia> widen(Float32)
Float64

julia> widen(Inf32)
Inf

julia> widen(Dec32)
ERROR: MethodError: no method matching widen(::Type{Dec32})
Closest candidates are:
  widen(::Type{T}) where T at operators.jl:808
  widen(::T) where T at operators.jl:807
  widen(::Type{Int8}) at int.jl:673
  ...
Stacktrace:
 [1] widen(::Type{Dec32}) at ./operators.jl:808
 [2] top-level scope at REPL[4]:1
@jmkuhn
Copy link
Contributor Author

jmkuhn commented May 6, 2020

Should widen(Dec128) return Dec128? I'm assuming we want x == widen(x) for any value x. If we widen to BigFloat that relation wouldn't necessarily hold (ignoring the fact that we haven't implemented comparison with BigFloat).

@stevengj
Copy link
Member

stevengj commented May 6, 2020

Seems like widen(Dec128) should throw a MethodError for now (i.e. be unimplemented).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants