Note: Built-In Function Rules Usage Options
Calculates a square root value.
Arguments
|
Return Values
|
Note: This function will truncate the root value into the return value. That is, if the return field is defined as digits(4) decimals(2) and the value of the square root is 1.41421, the value returned will be 01.41.
Examples
********** A simple square root calculator
DEFINE FIELD(#NUMBER1) TYPE(*DEC) LENGTH(15) DECIMALS(5) EDIT_CODE(3)
DEFINE FIELD(#RESULT) TYPE(*DEC) LENGTH(15) DECIMALS(5) EDIT_CODE(3)
********** Request number to calculate root from
REQUEST FIELDS(#NUMBER1)
********** Calculate square root
USE BUILTIN(SQUARE_ROOT) WITH_ARGS(#NUMBER1) TO_GET(#RESULT)
********** Display result
DISPLAY FIELDS(#NUMBER1 #RESULT)