nValueRadicand.
AdvPL GuideSqrt(nValue) -> nRootCalculates a numeric expression’s square root.
Documentation describes positive roots and zero for negative input. That zero cannot distinguish invalid input from the root of zero. Validate the domain before calling rather than expecting an exception for negatives. (Sources: refs. 1–1.)
Sqrt(nValue) -> nRootnValueRadicand.
Numeric; zero for negative input per TDN.
#Include "Protheus.ch"
User Function Ed673()
Local nValue := 81
// Reject a negative domain before calculation.
If nValue >= 0
ConOut(Sqrt(nValue))
EndIf
Return NilDisplays 9 for input 81. 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.