COBOL developers face difficulty to answer this question. The answer is for single precision data stored in 32 bits, and for double precision data stored in 64 bits of computer memory. Checkout here What is the difference between a 32-bit and 64-bit system?
What is comp-1
Comp-1 is also called a single-precision floating-point number. Picture clause is not required.
Single-precision floating-point format is a computer number format that occupies 4 bytes (32 bits) in computer memory and represents a wide dynamic range of values by using a floating-point. Checkout Single-precision floating-point format.
Comp-1 items are 4 bytes long. Internally data is stored in hexadecimal format. Example: 01 floattmp USAGE COMP-1In IEEE 754-2008 the 32-bit base 2 format is officially referred to as binary32. It was called single in IEEE 754-1985. In older computers, other floating-point formats of 4 bytes were used.
What is comp-2
Comp-2 is also called double-precision floating-point number. Picture clause is not required.
Double-precision floating-point format is a computer number format that occupies 8 bytes (64 bits) in computer memory and represents a wide dynamic range of values by using floating-point. Checkout Double-precision floating-point format.
So comp-2 items are 8 bytes long. Internally data is stored in hexadecimal format. Example: 01 floattmp2 USAGE COMP-2;Computers with 32-bit storage locations use two memory locations to store a 64-bit double-precision number (a single storage location can hold a single-precision number).
Double-precision floating-point format usually refers to binary64, as specified by the IEEE 754 standard, not to the 64-bit decimal format decimal64.
Related Posts
Outstanding learning resources
Learn any hobby with a little amount.
You must be logged in to post a comment.