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

Error in 2-norm computation #222

Closed
dpo opened this issue Jun 20, 2015 · 1 comment · Fixed by JuliaLang/julia#12571
Closed

Error in 2-norm computation #222

dpo opened this issue Jun 20, 2015 · 1 comment · Fixed by JuliaLang/julia#12571
Labels
bug Something isn't working

Comments

@dpo
Copy link

dpo commented Jun 20, 2015

julia> VERSION
v"0.4.0-dev+5413"
julia> norm([2.4e-322,4.4e-323])
Inf

The same happens in 3.x.

Python:

>>> import numpy as np
>>> np.linalg.norm([2.4e-322,4.4e-323])
0.0

Matlab:

>> norm([2.4e-322,4.4e-323])
ans =
  2.4703e-322
nalimilan referenced this issue in JuliaLang/julia Jun 20, 2015
No need to take the inverse too early. Fixes #11788.
nalimilan referenced this issue in JuliaLang/julia Jun 20, 2015
No need to take the inverse too early. Fixes #11788.
nalimilan referenced this issue in JuliaLang/julia Jun 20, 2015
No need to take the inverse too early. Fixes #11788.
@nalimilan
Copy link
Member

The issue is in the Julia generic implementation, Base.LinAlg.generic_vecnorm2, when taking the inverse of this:

julia> Base.LinAlg.vecnormInf([2.4e-322, 4.4e-323])
2.4e-322

julia> 1/Base.LinAlg.vecnormInf([2.4e-322, 4.4e-323])
Inf

I've made a PR to try to fix this: JuliaLang/julia#11789

@JeffBezanson JeffBezanson added bug Something isn't working linear algebra labels Jun 21, 2015
nalimilan referenced this issue in JuliaLang/julia Aug 11, 2015
No need to take the inverse too early. Fixes #11788.
andreasnoack referenced this issue in JuliaLang/julia Aug 11, 2015
elements in vecnorm methods. This fixes #11788.
andreasnoack referenced this issue in JuliaLang/julia Aug 11, 2015
elements in vecnorm methods. This fixes #11788.
andreasnoack referenced this issue in JuliaLang/julia Aug 11, 2015
elements in vecnorm methods. This fixes #11788.
@KristofferC KristofferC transferred this issue from JuliaLang/julia Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants