Skip to content

Commit b9baefc

Browse files
authored
Add note concerning the casting of boolean input arrays (#296)
1 parent 2461de3 commit b9baefc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

spec/API_specification/data_type_functions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Copies an array to a specified data type irrespective of {ref}`type-promotion` r
1717
Casting floating-point `NaN` and `infinity` values to integral data types is not specified and is implementation-dependent.
1818
```
1919

20+
```{note}
21+
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`.
22+
23+
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`.
24+
```
25+
2026
#### Parameters
2127

2228
- **x**: _<array>_

0 commit comments

Comments
 (0)