diff --git a/docs/src/manual.md b/docs/src/manual.md index d226055..af22cf7 100644 --- a/docs/src/manual.md +++ b/docs/src/manual.md @@ -171,6 +171,16 @@ ishalfinteger(4) ishalfinteger(1//3) ``` +### `ishalfodd` + +The function `ishalfodd` can be used to check whether a number is equal to some odd-half-integer, i.e., a number ``\frac{n}{2}`` where ``n`` is an odd integer: + +```@repl halfintegers +ishalfodd(0.5) +ishalfodd(4) +ishalfodd(1//3) +``` + ## Wraparound behavior Since the implementation of the `HalfInteger` type is based on the underlying integers (e.g., standard `Int` arithmetic in the case of the `HalfInt` type), `HalfInteger`s may be subject to [integer overflow](https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/#Overflow-behavior-1): diff --git a/src/HalfIntegers.jl b/src/HalfIntegers.jl index ba8a4db..9bc9339 100644 --- a/src/HalfIntegers.jl +++ b/src/HalfIntegers.jl @@ -565,7 +565,8 @@ ishalfinteger(::Missing) = missing """ ishalfodd(x) -Test whether `x` is numerically equal to some half-odd-integer. +Test whether `x` is numerically equal to some half-odd-integer, i.e., a number ``n/2`` where +``n`` is an odd integer. # Examples