Skip to content

Usage of _iszero, _isnotzero #609

Closed
@OlivierHnt

Description

@OlivierHnt

We are currently working on releasing the 1.0 version of IntervalArithmetic.jl (see JuliaIntervals/IntervalArithmetic.jl#698). One important decision we made is to be very strict with the usage of boolean comparison functions from Base. For instance, iszero(x::Interval) throws if x contains zero but is not thin, like $[-1, 1]$.

I noticed that you have two internal functions _iszero and _isnotzero which seems to be used only in the context "is the number exactly zero".

I found (on 1.11, but maybe also true on 1.10) that this is not used everywhere, e.g.

https://github.com/JuliaSparse/SparseArrays.jl/blob/242035184c0d539bdb5e64bf26eb7726b123db14/src/sparsevector.jl#L2384C8-L2384C21

Is it possible to replace all instances of x == zero(x) (and similar) with _iszero (or _isnotzero) ? If so, could this be backported to 1.10 and 1.11 as well?

Metadata

Metadata

Assignees

No one assigned

    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