nAngleAngle in radians.
AdvPL GuideCos( <nAngle> ) --> nRetCalculates an angle cosine in radians.
Cos accepts radians; convert degree input first. For calculations near zero or other limits, define an appropriate tolerance instead of relying on text representation or exact equality between computed values. Documentation warns about precision loss for very large angles. The example uses zero for a simple deterministic check. (TOTVS, n.d., ref. 1)
Cos( <nAngle> ) --> nRetnAngleAngle in radians.
Numeric cosine value.
#Include "Protheus.ch"
User Function Ed316()
// Zero radians equals zero degrees.
ConOut(cValToChar(Cos(0)))
Return NilExpected result: 1. 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.