Cypher Sqrt Function

sqrt() returns the square root of a number.

Syntax: sqrt(expression)

Returns: A Float.

Arguments

NameDescription
expressionA numeric expression.

Example

RETURN sqrt(16)

The value returned will be the square root of 16, Hence the value returned would be 4.0

Considerations

  • sqrt(null) returns null.
  • sqrt(<any negative number>) returns null

Example

RETURN sqrt(4)

Returns the following Result

sqrt(4)
2.0

Note– The value returned by the sqrt() function will always be a float.

Example

RETURN sqrt(5)

Returns the following Result

sqrt(5)
2.23606797749979

Example

RETURN sqrt(0)

Returns the following Result

sqrt(0)
0.0

Example

RETURN sqrt(null)

Returns the following Result

sqrt(null)
null

Notesqrt(null) returns null.

Example

RETURN sqrt(-7)

Returns the following Result

sqrt(-7)
null

Notesqrt(<Any Negative Number>) returns null.

Learn More