Skip to content

Commit ea76e6d

Browse files
authored
[backports 1.12] use < and > rather than isnegative and ispositive (#59807)
fixes #59705 (comment)
1 parent 120798a commit ea76e6d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

base/float.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,7 @@ end
851851
The result of `n` iterative applications of `nextfloat` to `x` if `n >= 0`, or `-n`
852852
applications of [`prevfloat`](@ref) if `n < 0`.
853853
"""
854-
nextfloat(f::AbstractFloat, d::Integer) = _nextfloat(f, isnegative(d), uabs(d))
854+
nextfloat(f::AbstractFloat, d::Integer) = _nextfloat(f, d < 0, uabs(d))
855855

856856
"""
857857
nextfloat(x::AbstractFloat)
@@ -869,7 +869,7 @@ nextfloat(x::AbstractFloat) = nextfloat(x, 1)
869869
The result of `n` iterative applications of `prevfloat` to `x` if `n >= 0`, or `-n`
870870
applications of [`nextfloat`](@ref) if `n < 0`.
871871
"""
872-
prevfloat(x::AbstractFloat, d::Integer) = _nextfloat(x, ispositive(d), uabs(d))
872+
prevfloat(x::AbstractFloat, d::Integer) = _nextfloat(x, d > 0, uabs(d))
873873

874874
"""
875875
prevfloat(x::AbstractFloat)

0 commit comments

Comments
 (0)