signbit¶
- signbit(x: array, /) array¶
Determines whether the sign bit is set for each element
x_iof the input arrayx.The sign bit of a real-valued floating-point number
x_iis set wheneverx_iis either-0, less than zero, or a signedNaN(i.e., aNaNvalue whose sign bit is1).- Parameters:
x (array) – input array. Should have a real-valued floating-point data type.
- Returns:
out (array) – an array containing the evaluated result for each element in
x. The returned array must have a data type ofbool.
Notes
Special cases
For real-valued floating-point operands,
If
x_iis+0, the result isFalse.If
x_iis-0, the result isTrue.If
x_iis+infinity, the result isFalse.If
x_iis-infinity, the result isTrue.If
x_iis a positive (i.e., greater than0) finite number, the result isFalse.If
x_iis a negative (i.e., less than0) finite number, the result isTrue.If
x_iisNaNand the sign bit ofx_iis0, the result isFalse.If
x_iisNaNand the sign bit ofx_iis1, the result isTrue.
New in version 2023.12.