Usina BRAdvPL Guide
Sign in
← All topics
FUNCTIONUnder review

Tan

Tan(nRadian) -> nValue

Calculates a trigonometric ratio from radians.

TanAdvPL
01 · OVERVIEW

Overview

Receives radians; convert degrees first. Tangent is undefined at odd multiples of pi/2 and unstable nearby. This example uses 45 degrees, away from singularities, rather than testing at pi/2. (Sources: refs. 1–1.)

02 · SYNTAX

Syntax

Tan(nRadian) -> nValue

Parameters

nRadian
NumericRequired

Angle in radians.

Return value

Numeric.

03 · PRACTICAL EXAMPLE

Commented example

#Include "Protheus.ch"

User Function Ed687()
    Local nRadians := 45 * 3.141592653589793 / 180
    // Convert units before calling the function.
    ConOut(Tan(nRadians))
Return Nil
Expected result

Approximately 1, subject to numeric representation. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

BEST PRACTICES
  • Validate the domain and precision required by the business calculation.
  • Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Related content

REFERENCES
  1. TOTVS. Tan. Sintaxe e observações. TDN. Accessed on 2026-10-28.
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