Cypher Sign Function

sign() returns the signum of the given number: 0 if the number is 0, -1 for any negative number, and 1 for any positive number.

Syntaxsign(expression)

Returns: An Integer.

Arguments

NameDescription
expressionA numeric expression.

Example

RETURN sign(1.3)

The value return the signum of 1.3, which will be 1.

Considerations

  • sign(null) returns null.

Example

RETURN sign(-1.7)

Returns the following Result

sign(-1.7)
-1

Example

RETURN sign(0)

Returns the following Result

sign(0)
0

Example

RETURN sign(7.0)

Returns the following Result

sign(7.0)
1

Example

RETURN sign(null)

Returns the following Result

sign(null)
null

Notesign(null) returns null.

Learn More