Skip to main content

SIGNBIT

Description​

Determine whether the sign bit of the given floating-point number is set.

Syntax​

SIGNBIT(<a>)

Parameters​

ParameterDescription
<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 |
+----------------------------+