Skip to content

Commit

Permalink
Change 'nonnegative' to 'non-negative' for consistency
Browse files Browse the repository at this point in the history
  • Loading branch information
fingolfin committed Sep 18, 2023
1 parent 7ba6303 commit 24f2e95
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/NCRings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ julia> A = powers(M, 4)
```
"""
function powers(a::T, d::Int) where {T <: Union{NCRingElement, MatElem}}
d < 0 && throw(DomainError(d, "the second argument must be nonnegative"))
d < 0 && throw(DomainError(d, "the second argument must be non-negative"))
a isa MatElem && !is_square(a) && throw(DomainError(a, "matrix must be square"))
M = Vector{T}(undef, d + 1)
M[1] = one(a)
Expand Down
4 changes: 2 additions & 2 deletions src/Poly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2890,7 +2890,7 @@ function polynomial_to_power_sums(f::PolyRingElem{T}, n::Int=degree(f)) where T
degree(f) < 1 && error("Polynomial has no roots")
!is_monic(f) && error("Requires monic polynomial")
iszero(constant_coefficient(f)) && error("Requires nonzero constant coefficient")
n < 0 && throw(DomainError(n, "number of terms must be nonnegative"))
n < 0 && throw(DomainError(n, "number of terms must be non-negative"))
d = degree(f)
R = base_ring(f)
# Beware: converting to power series and derivative do not commute
Expand All @@ -2917,7 +2917,7 @@ function polynomial_to_power_sums(f::PolyRingElem{T}, n::Int=degree(f)) where T
degree(f) < 1 && error("Polynomial has no roots")
!is_monic(f) && error("Requires monic polynomial")
iszero(constant_coefficient(f)) && error("Requires nonzero constant coefficient")
n < 0 && throw(DomainError(n, "number of terms must be nonnegative"))
n < 0 && throw(DomainError(n, "number of terms must be non-negative"))
d = degree(f)
R = base_ring(f)
if n == 0
Expand Down
2 changes: 1 addition & 1 deletion src/generic/AbsMSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

function O(R::AbsMSeriesRing{T}, prec::Int) where T <: RingElement
R.weighted_prec != -1 && error("Operation not possible in weighted rings")
prec < 0 && error("Precision must be nonnegative")
prec < 0 && error("Precision must be non-negative")
return R(poly_ring(R)(), fill(prec, nvars(R)))
end

Expand Down
4 changes: 2 additions & 2 deletions src/generic/Ideal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1576,7 +1576,7 @@ function reduce_tail(f::T, V::AbstractVector{T}, res::U) where {U <: RingElement
i -= 1
end
if i != 0 && !iszero(c)
h = leading_coefficient(V[i]) # should be nonnegative
h = leading_coefficient(V[i]) # should be non-negative
q, r = AbstractAlgebra.divrem(c, h)
u = shift_left(V[i], n - length(V[i]))
p -= q*u
Expand Down Expand Up @@ -1608,7 +1608,7 @@ function normal_form(p::T, V::Vector{T}) where {U <: RingElement, T <: AbstractA
i -= 1
end
if i != 0 && !iszero(c)
h = leading_coefficient(V[i]) # should be nonnegative
h = leading_coefficient(V[i]) # should be non-negative
q, r = AbstractAlgebra.divrem(c, h)
u = shift_left(V[i], n - length(V[i]))
p -= q*u
Expand Down
2 changes: 1 addition & 1 deletion src/generic/MapCache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ codomain(M::MapCache{D, C}) where {D, C} = codomain(M.map)::C
image_fn(M::MapCache{D, C}) where {D, C} = image_fn(M.map)

function set_limit!(M::MapCache, limit::Int)
limit < 0 && error("Limit must be nonnegative")
limit < 0 && error("Limit must be non-negative")
M.limit = limit
end

Expand Down

0 comments on commit 24f2e95

Please sign in to comment.