--- type: "fhirpath-function" title: "FHIRPath Function: sqrt" function: "sqrt" category: "Math" section: "5.8.9" source: "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} ``` fhirpath 81.sqrt() // 9.0 (-1).sqrt() // empty ``` {:.stu} ## Summary - **Category**: Math - **Section**: `5.8.9` - **Return Type**: `Decimal` - **Empty Input Result**: `empty` - **Errors on Multiple Input**: `true` ## Description Returns the square root of the input number as a Decimal. ## Arguments - none ## Type Mapping - `Integer-Decimal` - `Long-Decimal` - `Decimal-Decimal` ## Example ```fhirpath 81.sqrt() // 9.0 (-1).sqrt() // empty ```