Skip to content

Commit

Permalink
improve some floatting-point test comparisons
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Mar 14, 2024
1 parent 2e95872 commit 68f0d89
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/CellOperations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -617,13 +617,17 @@ end
@test cell_limits(m) == ([0.0, 0.0], [15.0, 15.0])

mr, _ = align_cell(m)
@test cell_limits(mr) == ([0.0, 0.0], [20.12461179749811, 6.708203932499369])
cl = cell_limits(mr)
@test cl[1] [0.0, 0.0] atol = 1e-10
@test cl[2] [20.12461179749811, 6.708203932499369]

m = [10 5; 0 10]
@test cell_limits(m) == ([0.0, 0.0], [15.0, 10.0])

mr, _ = align_cell(m)
@test cell_limits(mr) == ([0.0, -8.94427190999916], [15.652475842498529, 0.0])
cl = cell_limits(mr)
@test cl[1] [0.0, -8.94427190999916]
@test cl[2] [15.652475842498529, 0.0]

m = [1 0 0; 0 1 0; 0 0 1]
@test cell_limits(m) == ([0.0, 0.0, 0.0], [1.0, 1.0, 1.0])
Expand Down

0 comments on commit 68f0d89

Please sign in to comment.