kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jan 28, 2004 8:52 am Post subject: |
|
|
Saravan,
The performance of the variables(comp or comp-3) depends on the type of arithmetic you are doing, and the final disposition of the results.
If your calculation is pure integer arithmetic, COMP is the best choice.
For calculation involving decimal portions (money related ), COMP-3 is the best choice.
For scientific calculation , sines, cosines, random number generation, COMP-2 is the best choice.
You can do a test for yourself. Code 2 different pgms with the same compute statement but fields defined as comp and comp-3. Add the following statement before the ID division
The above parameter will produce a listing of the assembler-language expansion of your source code. Now take a look at the compiler listing after successful compilation. The compute statement which generates least instructions will answer your question.
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|