Skip to content

Add note concerning the casting of boolean input arrays #296

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

Merged
merged 1 commit into from
Nov 1, 2021
Merged
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
6 changes: 6 additions & 0 deletions spec/API_specification/data_type_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ Copies an array to a specified data type irrespective of {ref}`type-promotion` r
Casting floating-point `NaN` and `infinity` values to integral data types is not specified and is implementation-dependent.
```

```{note}
When casting a boolean input array to a numeric data type, a value of `True` must cast to a numeric value equal to `1`, and a value of `False` must cast to a numeric value equal to `0`.

When casting a numeric input array to `bool`, a value of `0` must cast to `False`, and a non-zero value must cast to `True`.
```

#### Parameters

- **x**: _<array>_
Expand Down