SIGNBIT
Descriptionβ
Determine whether the sign bit of the given floating-point number is set.
Syntaxβ
SIGNBIT(<a>)
Parametersβ
Parameter | Description |
---|---|
<a> | Floating-point number to check the sign bit for |
Return Valueβ
Returns true if the sign bit of <a>
is set (i.e., <a>
is negative), otherwise returns false.
Examplesβ
select signbit(-1.0);
+-----------------------------+
| signbit(cast(-1 as DOUBLE)) |
+-----------------------------+
| true |
+-----------------------------+
select signbit(0.0);
+----------------------------+
| signbit(cast(0 as DOUBLE)) |
+----------------------------+
| false |
+----------------------------+
select signbit(1.0);
+----------------------------+
| signbit(cast(1 as DOUBLE)) |
+----------------------------+
| false |
+----------------------------+