Skip to content

@math:ln

The natural logarithm of a wad-scaled value, in wad (1e18) fixed point. The inverse of exp: it turns a growth factor back into the rate that produced it.

On-chain (@math:ln!): The result carries its wad scale, so surrounding arithmetic aligns to it; the plain face hands back the raw wad integer.

Returns: number

@math:ln(value)
NameTypeDescription
valuenumberWad-scaled value, strictly above zero
# TODO: add examples

Natural log in wad fixed point, as one lnWad read. Signed (Int), scale 18, so it is the inverse of @exp! at the same unit.

A constant at or below zero is rejected at composition time, where the message can name the helper. A LIVE value that turns out to be zero cannot be caught there and reverts when the assertion is judged.

  • The domain check only fires for constants; a live zero reverts on-chain.