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

round does not work with functor and tuples #12494

Closed
SimonDanisch opened this issue Aug 6, 2015 · 2 comments
Closed

round does not work with functor and tuples #12494

SimonDanisch opened this issue Aug 6, 2015 · 2 comments

Comments

@SimonDanisch
Copy link
Contributor

immutable RoundFunc <: Base.Func{1} end
Base.call(::RoundFunc, i) = round(i)

julia> map(round, (0.777, 0.777,0.777, 0.777))
(1.0,1.0,1.0,1.0)
julia>  map(RoundFunc(), [0.777f0, 0.777f0,0.777f0, 0.777f0])
4-element Array{Float32,1}:
 1.0
 1.0
 1.0
 1.0
julia> map(RoundFunc(), (0.777f0, 0.777f0,0.777f0, 0.777f0))
(1.0f0,8.388608f6,NaN32,NaN32)

julia> map(RoundFunc(), (0.777f0, 0.777f0, 0.777f0))
(1.0f0,8.388608f6,NaN32)

julia> map(RoundFunc(), (0.777f0, 0.777f0))
(1.0f0,1.0f0)

julia> map(RoundFunc(), (0.777, 0.777,0.777, 0.777))
(1.0,4.503599627370496e15,NaN,NaN)

julia> map(RoundFunc(), (0.777, 0.777, 0.777))
(1.0,4.503599627370496e15,NaN)

julia> map(RoundFunc(), (0.777, 0.777))
(1.0,1.0)
julia> versioninfo()
Julia Version 0.4.0-dev+6492
Commit a6c78b6* (2015-08-04 07:48 UTC)
Platform Info:
  System: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i5-4200U CPU @ 1.60GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

Best,
Simon

@simonster
Copy link
Member

Works for me on Linux. Maybe another Windows LLVM 3.3 tuple issue (ref #7434)? Is the result actually incorrect, or is show just malfunctioning?

@JeffBezanson
Copy link
Sponsor Member

dup of #12163

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

No branches or pull requests

3 participants