If the input is positive, for example, 10, the returned sum should be:
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = 55.
- If the input is negative, for example, -10, the returned sum should be:
-10 -9 - 8 - 7 -6 - 5 - 4 - 3 - 2 - 1 = -55.
You need to create two versions of the function. One is implemented in NUMBER datatype and the other
in BINARY INTEGER.
Once these two functions are created, you need to create a testing procedure in which the execution speed
of the two sum functions are compared. The testing procedure should have a similar output as the one
bSum(40000) = 800020000
Time used in running bSum(10000): 5 miliseconds
nSum(40000) = 800020000
Time used in running nSum(10000): 20 miliseconds
where bSum and nSum are the names of the sum function implemented in BINARY INTEGER and NUMBER
respectively. In implementing the testing function, you may need to use TIMESTAMP, SYSTIMESTAMP,
INTERVAL DAY TO SECOND, and EXTRACT to get the needed information for output.
تم التعديل بواسطة free2000000, 20 April 2010 - 04:23 PM.