This workroom hosts code machine Test6, with alias of t, which verifies the computation of square root values by checking the mathematical property of square roots. Namely, the square root of a number to the second power should produce the original number, if the square root was computed correctly. The program in Test6 checks that the square roots computed for a 100 random numbers fulfill that property. The test for each number is passed if the square of the computed square root and the original number are approximately equal. The comparison of the two is performed using the method of class Numeric, where the two floating point numbers are considered equal if the difference between them is less than 1E-12.
To receive help with code machine commands type 'help t'.
You see:
Test6
Links:
Test Case Evaluation
Validating output using an oracle
Sample Run Output to Test6