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

Failure of constructing linspace #10873

Closed
lindahua opened this issue Apr 18, 2015 · 6 comments
Closed

Failure of constructing linspace #10873

lindahua opened this issue Apr 18, 2015 · 6 comments

Comments

@lindahua
Copy link
Contributor

I encountered this while fixing issues in Distributions.jl:

dhlin:~/.julia/v0.4/Distributions$ julia
               _
   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "help()" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.0-dev+4319 (2015-04-17 03:26 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit ef06211 (0 days old master)
|__/                   |  x86_64-apple-darwin14.3.0

julia> linspace(0.030151007560504324, 13.81551055796427, 50)
linspace(0.030151007560504324,13.81551055796427,50)

julia> linspace(0.030151007560504324, 13.81551055796427, 51)
ERROR: linspace(0.030151007560504324, 13.81551055796427, 51.0): cannot be constructed
 in error at error.jl:19
 in linspace at range.jl:220
 in linspace at range.jl:225

Why 50 works but not 51?

The version is pretty recent: Version 0.4.0-dev+4319 (2015-04-17 03:26 UTC).

@pao
Copy link
Member

pao commented Apr 18, 2015

#9666?

@lindahua
Copy link
Contributor Author

I see. Closing this then.

@pao
Copy link
Member

pao commented Apr 18, 2015

Well, I'm glad you made sense of it. I'm still lost (and am pretty sure linspace is no longer usable if it's going to be this picky.)

@mbauman
Copy link
Sponsor Member

mbauman commented Apr 18, 2015

I'm afraid that this should be reopened. I don't think it's okay for linspace to be erroring so often. It fails about 20% of the time with the rather simple linspace(rand(), 2, 8).

@mbauman mbauman reopened this Apr 18, 2015
@pao
Copy link
Member

pao commented Apr 18, 2015

cc @StefanKarpinski

@StefanKarpinski
Copy link
Sponsor Member

This is my doing. Will fix shortly.

StefanKarpinski added a commit that referenced this issue Apr 18, 2015
This allows construction of linear ranges such as

	julia> linspace(0.030151007560504324, 13.81551055796427, 51)
	linspace(0.030151007560504324,13.815510557964268,51)

Note, however, that one of the endpoints is not exactly what was
requested. It's unclear how to best resolve this issue. #10873
mbauman pushed a commit to mbauman/julia that referenced this issue Jun 6, 2015
This allows construction of linear ranges such as

	julia> linspace(0.030151007560504324, 13.81551055796427, 51)
	linspace(0.030151007560504324,13.815510557964268,51)

Note, however, that one of the endpoints is not exactly what was
requested. It's unclear how to best resolve this issue. JuliaLang#10873
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

4 participants