Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ishalfodd to manual #63

Merged
merged 1 commit into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/src/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
3 changes: 2 additions & 1 deletion src/HalfIntegers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading