nCosCosine within the closed interval [-1, 1].
AdvPL GuideACos( <nCos> ) --> nRetCalculates the inverse cosine in radians.
ACos receives an angle cosine within -1 to 1 and returns an angle from zero to PI radians. Its input is not degrees. Documentation describes an undefined result outside the domain; validate input rather than depending on an infinity representation. (TOTVS, n.d., ref. 1)
ACos( <nCos> ) --> nRetnCosCosine within the closed interval [-1, 1].
Numeric from 0 to PI, in radians.
#Include "Protheus.ch"
User Function EdAcos()
Local nCosine := 0
// Check the domain before calculating.
If nCosine >= -1 .And. nCosine <= 1
ConOut(cValToChar(ACos(nCosine)))
EndIf
Return NilExpected result approximately 1.5707963268 radians, equivalent to 90 degrees. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
© 2026 Usina.BR. All rights reserved. TOTVS, Protheus, Microsiga and their respective logos are trademarks of their owners. AdvPL Guide is independent and uses limited, attributed excerpts justified by educational purposes. See the Terms of Use. Terms of Use
Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.