NOTICE: Our Community is moving. Get more information. Updated information on a New Login Process
Maths functions are currently not available within the 4Test proprietary language. There are many ways to perform this task, two of which are to use either Java (using the Silk4J eclipse plugin) and the math library within the Java language, or we can also use the math library available in the C/C++ language. The C/C++ language is advantageous as it allows us to create a dll which contains the math functions required, which in turn, we can call from SilkTest by calling the functions available in the dll file. This is available in the downloadable attachment Math.zip.
This archive contains the following files: Math.dll Math.inc These files provide the cmath library functions to enable math functions to be used in SilkTest. The functions available in the dll file are the functions available in the cmath library . cmath declares a set of functions to compute common mathematical operations and transformations Software Requirements: SilkTest Setup Instruction: 1. Extract the Math folder in the archive to the SilkTest installation directory Description: The following functions are available in Math.inc TRIGONOMETRIC FUNCTIONS _cos (double num) _sin (double num) _tan (double num) _acos (double num) _asin (double num) _atan (double num) _atan2 (double y, double x) HYPERBOLIC FUNCTIONS _cosh (double num) _sinh (double num) _tanh (double num) EXPONENTIAL AND LOGARITHMIC FUNCTIONS _exp (double num) _frexp (double num) _ldexp (double num, int exp) _In (double num) _log10 (double num) _log (double num, double base) _modf (double num) POWER FUNCTIONS _pow (double base, double exp) _sqrt (double num) ROUNDING, ABSOLUTE VALUE AND REMAINDER FUNCTIONS _ceil (double num) _fabs (double num) _floor (double num) _fmod (double numerator, double denominator) ROUND VALUES REAL Round (REAL rOriginal, INTEGER iPlaces optional) Usage: Once the Math folder has been extracted to the SilkTest installation directory, user can specify the Math.inc file in the SilkTest Runtime Options or within the Testscript file. Specifying Math.inc in the SilkTest Runtime Options for usage across SilkTest project: 1. From SilkTest, goto Options | Runtime 2. In the "Use files" section, add "Math\Math.inc" Specifying Math.inc in SilkTest Testscript file for usage in a single Testscript file: 1. Add the following line at the beginning of the Testscript fileuse "Math\Math.inc"