signbit

Syntax

signbit(X)

Arguments

X is a floating-point or integer scalar.

Details

Detect the sign bit of the input value.

Return value: true if X is negative, false otherwise.

Examples

$ signbit('a')
false

$ signbit(-21)
true

$ signbit(-2.1)
true

$ b=complex(10,-5)// create a complex number
$ b
10.0-5.0i
$ signbit(highDouble(b)) // detect the sign bit of the imaginary number
true
$ signbit(lowDouble(b))  // detect the sign bit of the real number
false