View raw Markdown
type: fhirpath-functionfunction: sqrtcategory: Mathsection: 5.8.9source: fhirpath/functions.json

FHIRPath Function: sqrt

{:.stu}

Returns the square root of the input number. {:.stu}

Accepts Decimal input types. Integer and Long types are also accepted via implicit conversion to Decimal. {:.stu}

If the square root cannot be represented (such as the square root of -1), the result is empty. {:.stu}

If the input collection is empty, the result is empty. {:.stu}

If the input collection contains multiple items, the evaluation of the expression will end and signal an error to the calling environment. {:.stu}

Note that this function is equivalent to raising a number of the power of 0.5 using the power() function. {:.stu}

81.sqrt() // 9.0
(-1).sqrt() // empty

{:.stu}

Summary

Description

Returns the square root of the input number as a Decimal.

Arguments

Type Mapping

Example

81.sqrt() // 9.0
(-1).sqrt() // empty