type: fhirpath-functionfunction: logcategory: Mathsection: 5.8.6source: fhirpath/functions.json
FHIRPath Function: log
{:.stu}
Returns the logarithm base base of the input number.
{:.stu}
Accepts Decimal input types. Integer and Long types are also accepted via implicit conversion to Decimal. {:.stu}
If the input is 0 or negative, the evaluation will end and signal an error to the calling environment. If the base argument is 0 or negative, the evaluation will end and signal an error to the calling environment. {:.stu}
If base is empty, 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}
16.log(2) // 4.0
100.0.log(10.0) // 2.0
Summary
- Category: Math
- Section:
5.8.6 - Return Type:
Decimal - Empty Input Result:
empty - Errors on Multiple Input:
true
Description
Returns the logarithm base base of the input number.
Arguments
Type Mapping
Example
16.log(2) // 4.0
100.0.log(10.0) // 2.0