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

weird dispatch/inference/arithmetic bug #158

Closed
StefanKarpinski opened this issue Jul 26, 2011 · 5 comments
Closed

weird dispatch/inference/arithmetic bug #158

StefanKarpinski opened this issue Jul 26, 2011 · 5 comments
Assignees
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@StefanKarpinski
Copy link
Member

julia> f(x::Number, y::Number) = x^2 - 2y + 1

julia> f(2, 3.0)
-4611686018427387903
@ghost ghost assigned JeffBezanson Jul 26, 2011
@JeffBezanson
Copy link
Member

Hate to say it but works for me. Interesting though:

julia> f(x::Number, y::Number) = x^2 - 2y + 1

julia> f(2, 3.0)
-1.0

julia> hex(4611686018427387903)
"3fffffffffffffff"

julia> num2hex(1.0)
"3ff0000000000000"

The bits seem to be related to the correct answer in some weird way.

Is this your normal build? Passing all other tests?

@StefanKarpinski
Copy link
Member Author

Yeah, I checked it multiple times because it seemed so out of character. It looks almost like a case of arithmetic extension where zero extension should be used. Strange.

@JeffBezanson
Copy link
Member

Turns out to be a type inference problem. Working on it.
I get this in promote_type:

promote_rule::F(T::T<:Union(Int64,Complex128),S::Type{Float64})::None

The first argument should be of type Type{T<:Union(...)}.

@ViralBShah
Copy link
Member

BTW, it does work for me. Not sure if this is because it is already fixed, or my setup is unaffected.

JeffBezanson added a commit that referenced this issue Jul 31, 2011
give None for a call where some arguments are None
  this deals with issue #159
planning new constraint solving algorithm for type intersection
  this deals with issue #158
@JeffBezanson
Copy link
Member

fixed in commit b483b55

KristofferC pushed a commit that referenced this issue Aug 25, 2023
Stdlib: Tar
URL: https://github.com/JuliaIO/Tar.jl.git
Stdlib branch: master
Julia branch: master
Old commit: ff55460
New commit: 81888a3
Julia version: 1.11.0-DEV
Tar version: 1.10.0 (Does not match)
Bump invoked by: @DilumAluthge
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaIO/Tar.jl@ff55460...81888a3

```
$ git log --oneline ff55460..81888a3
81888a3 Correct some typos (#159)
a82ddde Fix some issues found by JET (#162)
6c51ea7 Give hint about possible insufficient storage on error message (#161)
84e6571 minimize impact of invalidations due to uninferred `ctx` (#158)
b0b8ec7 Merge pull request #157 from JuliaIO/dependabot/github_actions/actions/checkout-3
24bb56d Merge pull request #156 from JuliaIO/dependabot/github_actions/codecov/codecov-action-3
9f7d944 Merge pull request #155 from JuliaIO/dependabot/github_actions/actions/cache-3
d14feb4 Bump actions/checkout from 2 to 3
f149f85 Bump codecov/codecov-action from 1 to 3
ea228f2 Bump actions/cache from 1 to 3
4b54b0c Merge pull request #153 from ranocha/hr/dependabot
c70adcb enable dependabot for GitHub actions
cf089ab fix some sources of invalidations (#152)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Keno pushed a commit that referenced this issue Oct 9, 2023
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