From e2505739540abc2ead6a2232451e68d6ebf63b10 Mon Sep 17 00:00:00 2001 From: Athan Reines Date: Mon, 1 Nov 2021 10:43:49 -0700 Subject: [PATCH] Add note concerning the casting of boolean input arrays --- spec/API_specification/data_type_functions.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/API_specification/data_type_functions.md b/spec/API_specification/data_type_functions.md index 0f1dc512d..69a595b93 100644 --- a/spec/API_specification/data_type_functions.md +++ b/spec/API_specification/data_type_functions.md @@ -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>_