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

Function wrapping: use elementwise === for Expr equality #734

Closed
fonsp opened this issue Nov 29, 2020 · 1 comment
Closed

Function wrapping: use elementwise === for Expr equality #734

fonsp opened this issue Nov 29, 2020 · 1 comment
Assignees

Comments

@fonsp
Copy link
Owner

fonsp commented Nov 29, 2020

Example:

x = 2.5
begin
	y = fill(0, 3)
	y[2] = x
	y
end

will give this error (which it should!)

InexactError: Int64(2.5)

    Int64@float.jl:710[inlined]
    convert@number.jl:7[inlined]
    setindex!@array.jl:847[inlined]
    top-level scope@Local: 3[inlined]

Now, changing the second cell to:

begin
	y = fill(0.0, 3)
	y[2] = x
	y
end

(0.0 instead of 0) should fix the error, but it doesn't, because 0 == 0.0 => the expressions are equal.

@fonsp fonsp self-assigned this Nov 29, 2020
@fonsp
Copy link
Owner Author

fonsp commented Nov 29, 2020

or the hash

@fonsp fonsp closed this as completed in 9e0c8bd Nov 29, 2020
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

1 participant