From f442e9baeaa3d7c94fb4cd4c2b08ea605b379de9 Mon Sep 17 00:00:00 2001 From: Andy Dienes Date: Fri, 10 Oct 2025 09:06:06 -0400 Subject: [PATCH] use < and > rather than isnegative and ispositive --- base/float.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/float.jl b/base/float.jl index 8455b3fdbf152..64f7998aac3a2 100644 --- a/base/float.jl +++ b/base/float.jl @@ -851,7 +851,7 @@ end The result of `n` iterative applications of `nextfloat` to `x` if `n >= 0`, or `-n` applications of [`prevfloat`](@ref) if `n < 0`. """ -nextfloat(f::AbstractFloat, d::Integer) = _nextfloat(f, isnegative(d), uabs(d)) +nextfloat(f::AbstractFloat, d::Integer) = _nextfloat(f, d < 0, uabs(d)) """ nextfloat(x::AbstractFloat) @@ -869,7 +869,7 @@ nextfloat(x::AbstractFloat) = nextfloat(x, 1) The result of `n` iterative applications of `prevfloat` to `x` if `n >= 0`, or `-n` applications of [`nextfloat`](@ref) if `n < 0`. """ -prevfloat(x::AbstractFloat, d::Integer) = _nextfloat(x, ispositive(d), uabs(d)) +prevfloat(x::AbstractFloat, d::Integer) = _nextfloat(x, d > 0, uabs(d)) """ prevfloat(x::AbstractFloat)