Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Log

Log(nValue) -> nResult

Calculates the natural logarithm, base e.

LogAdvPL
01 · OVERVIEW

Overview

Takes a numeric value. For finite real results this example requires strictly positive input. Absence of runtime errors is not mathematical-domain or precision validation. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

Log(nValue) -> nResult

Parameters

nValue
NumericRequired

Positive value in this subset.

Return value

Numeric logarithm result.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed509()
    Local nValue := 1
    // Validate the domain before calling.
    If nValue > 0
        ConOut(cValToChar(Log(nValue)))
    EndIf
Return Nil
Expected result

Result: 0. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Define numerical tolerance and handle invalid inputs in the caller.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Log. TDN. Accessed on 2026-10-27.
Status
Under review
Page created on
Last reviewed on
Original language
Portuguese
Reviewed by
Usina.BR
0 approved comment(s)

Comments

There are no approved comments yet.

Sign in with Google or Microsoft to comment.

Powered by Usina Docs · Alpha