Skip to content

Commit

Permalink
Add defns of is_nilpotent for ZZRingElem & QQFieldElem
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnAAbbott committed Dec 13, 2024
1 parent 6c5912f commit 9cb13a3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/flint/fmpq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ is_zero(a::QQFieldElemOrPtr) = is_zero(_num_ptr(a))

is_unit(a::QQFieldElem) = !iszero(a)

is_nilpotent(a::QQFieldElem) = iszero(a)

isinteger(a::QQFieldElemOrPtr) = is_one(_den_ptr(a))

isfinite(::QQFieldElem) = true
Expand Down
2 changes: 2 additions & 0 deletions src/flint/fmpz.jl
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ size(a::ZZRingElem) = _fmpz_is_small(a) ? 1 : abs(_fmpz_size(a))

is_unit(a::ZZRingElemOrPtr) = data(a) == 1 || data(a) == -1

is_nilpotent(a::ZZRingElemOrPtr) = iszero(data(a))

is_zero(a::ZZRingElemOrPtr) = data(a) == 0

is_one(a::ZZRingElemOrPtr) = data(a) == 1
Expand Down

0 comments on commit 9cb13a3

Please sign in to comment.