Skip to content

Watch out for approx in Julia when compared to zero #115

Open
@mykelk

Description

@mykelk

(Thanks to Kathryn Lesh)

We use this in Alg 19.2, which is pretty much the same as exact equality comparison with 0. Comparison to 0 is handled a bit differently. See, for example, this link and links from there to the Julia issue tracker and justification. The kind of behavior referenced is something like this:

julia> 1.2e-16≈0

false

julia> 1+1.2e-16≈1

true

julia> isapprox(1.2e-16, 0.0; atol=1e-15, rtol=0)

true

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions