Ameba Ownd

アプリで簡単、無料ホームページ作成

beiverhedah1972's Ownd

Why comp is used in cobol

2022.01.06 17:40




















If you do, you can break things, and it can be a very, very subtle break. Do use COMP-5, for individual field-definitions, where you need to. Where do you need to? For any place you have a binary field whose range is beyond the "decimal value" of its PICture. Individual options can also be "fixed" at installation time.


Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 4 years, 8 months ago. Active 1 year, 3 months ago. Viewed 11k times. Improve this question.


Dhruv Saxena 1, 2 2 gold badges 12 12 silver badges 28 28 bronze badges. Ashi Ashi 11 1 1 gold badge 1 1 silver badge 3 3 bronze badges. Why don't you find the maximum value a four-byte binary can hold, then count how many digits that is? Ashi - is there anything missing in Bill's answer?


Data name length Length in COBOL 9 01 to 9 04 2 bytes 9 05 to 9 09 4 bytes S9 10 to S9 18 8 bytes COMPIn this case the data item will be represented in one word in the floating point form the number is actually represented in hexadecimal format and is suitable for arithmetic operations.


COMP-1 takes 4 bytes of storage. The advantage is that this increases the precision of the data, which means that more significant digits are available. While using COMP-3 for computation then use 15 or fewer digits in PIC clause to avoid the use of library routines for multiplication and division. Using a signed data item with an odd number of digits produces more efficient code since this uses an integral multiple of bytes in storage for the data item.


Remember Me. Create a new account. It requires 8 bytes as sign and decimal doesn't require any byte. It requires 5 bytes as sign. Remember Me Forgot Password? Link Text. Open link in a new tab. Post a Comment.


COMP usage clause applicable to Numeric data type only. COMP usage is a binary representation of data. The data in COMP variables stored memory in pure binary format. COMP-1 usage clause will be called as Floating point.


COMP-1 usage clause is applicable to single floating point data type. COMP-1 is specified for internal floating point items which is single precision.