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

BUG: arithmetic with linspace incorrect #12195

Closed
sglyon opened this issue Jul 17, 2015 · 3 comments
Closed

BUG: arithmetic with linspace incorrect #12195

sglyon opened this issue Jul 17, 2015 · 3 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@sglyon
Copy link
Contributor

sglyon commented Jul 17, 2015

Consider:

julia> x = linspace(0.01, 0.99, 12)
linspace(0.01,0.99,12)

julia> collect(1 - x)
12-element Array{Float64,1}:
  0.0
 -0.0890909
 -0.178182
 -0.267273
 -0.356364
 -0.445455
 -0.534545
 -0.623636
 -0.712727
 -0.801818
 -0.890909
 -0.98

julia> 1 - collect(x)
12-element Array{Float64,1}:
 0.99
 0.900909
 0.811818
 0.722727
 0.633636
 0.544545
 0.455455
 0.366364
 0.277273
 0.188182
 0.0990909
 0.01
@yuyichao yuyichao added the bug Indicates an unexpected problem or unintended behavior label Jul 17, 2015
@yuyichao
Copy link
Contributor

Likely my fault: #11233 although I though I have added tests for all operators I added... Will investigate after a meeting if no one beats me.

@sglyon
Copy link
Contributor Author

sglyon commented Jul 17, 2015

I know this conversation has happened already, but I can't seem to find it: why do we have both LinSpace and FloatRange?

@StefanKarpinski
Copy link
Member

#9666

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants