Module DA.Math

Math - Utility Math functions for Decimal The this library is designed to give good precision, typically giving 9 correct decimal places. The numerical algorithms run with many iterations to achieve that precision and are interpreted by the Daml runtime so they are not performant. Their use is not advised in performance critical contexts.

Functions

(**)

: Decimal -> Decimal -> Decimal

Take a power of a number Example: 2.0 ** 3.0 == 8.0.

sqrt

: Decimal -> Decimal

Calculate the square root of a Decimal.

>>> sqrt 1.44
1.2
exp

: Decimal -> Decimal

The exponential function. Example: exp 0.0 == 1.0

log

: Decimal -> Decimal

The natural logarithm. Example: log 10.0 == 2.30258509299

logBase

: Decimal -> Decimal -> Decimal

The logarithm of a number to a given base. Example: log 10.0 100.0 == 2.0

sin

: Decimal -> Decimal

sin is the sine function

cos

: Decimal -> Decimal

cos is the cosine function

tan

: Decimal -> Decimal

tan is the tangent function