Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Log10

Log10(nValue) -> nResult

Calculates the base-10 logarithm.

Log10AdvPL
01 · OVERVIEW

Overview

The reference warns of undefined results for negative values and infinity for zero. Rounding can affect numerical exactness. This example uses 100 with explicit domain validation. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

Log10(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 Ed510()
    Local nValue := 100
    // Validate the domain before calling.
    If nValue > 0
        ConOut(cValToChar(Log10(nValue)))
    EndIf
Return Nil
Expected result

Expected result approximately 2. 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. Log10. 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