Skip to content

Instantly share code, notes, and snippets.

@dietercastel
Created October 24, 2019 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dietercastel/4ff276ad7d70ba91321a070de72b00f3 to your computer and use it in GitHub Desktop.
Save dietercastel/4ff276ad7d70ba91321a070de72b00f3 to your computer and use it in GitHub Desktop.
Elementwise vs overall Approx Bug Julia?
using Test
alldigits = cat([[0.375297 0.624703]; [0.39924 0.60076]], [[0.664557 0.335443]; [0.664557 0.335443]], dims=3)
threedig = map(x -> round(x,digits=3), alldigits)
@testset "Testing" begin
@test size(alldigits) == size(threedig)
@test all(isapprox.(alldigits, threedig, atol=1e-3))
#This one fails???
@test isapprox(alldigits, threedig, atol=1e-3)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment