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

Winston messes with bigint #311

Closed
my-little-repository opened this issue Feb 9, 2022 · 3 comments
Closed

Winston messes with bigint #311

my-little-repository opened this issue Feb 9, 2022 · 3 comments

Comments

@my-little-repository
Copy link
Contributor

The following weird behavior appears with julia 1.7.1 and Winston v0.15.2

julia> big(1//2)
1//2

julia> using Winston
Gtk-Message: 14:17:40.676: Failed to load module "canberra-gtk-module"
Gtk-Message: 14:17:40.677: Failed to load module "canberra-gtk-module"

julia> big(1//2)
0//0
@hycakir
Copy link

hycakir commented Feb 9, 2022

I think this is about Base.range, extended by Winston.jl.

range(a::Real, b::Real) = (a <= b) ? (ceil(Int, a):floor(Int, b)) :

This breaks the behavior for BigInts since BigInt is a Real. This extended version is called, which is incorrect for BigInt.

I do not know why Winston.jl extends range in such a way. At least, what can be done is to limit the Real parameters to Union{AbstractFloat, AbstractIrrational, Rational}. Perhaps, considering why extending this method is needed might be a better, since pretty much all the range calls are handled by Winston.jl

@tknopp
Copy link
Collaborator

tknopp commented Feb 9, 2022

Probably because Winston.jl was developed against something like Julia v0.2? So its really just because of Julia having changed quite strongly.

@my-little-repository
Copy link
Contributor Author

my-little-repository commented May 12, 2022

I can't reproduce the bug with julia 1.6.6 and same version of Winston v0.15.2. I don't have julia 1.7.2 at hand for a test though.

EDIT: the bug can be reproduced with julia 1.7.3 and julia 1.8.2.

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