COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Match the data descriptions with the four data types for the following:A dollar amount
A
String
B
Floating point
C
Boolean
D
Integer
Explanation: 

Detailed explanation-1: -The MONEY data type stores currency amounts. TLike the DECIMAL(p, s) data type, MONEY can store fixed-point numbers up to a maximum of 32 significant digits, where p is the total number of significant digits (the precision) and s is the number of digits to the right of the decimal point (the scale).

Detailed explanation-2: -The FLOAT data type stores double-precision floating-point numbers with up to 17 significant digits. FLOAT corresponds to IEEE 4-byte floating-point, and to the double data type in C. The range of values for the FLOAT data type is the same as the range of the C double data type on your computer.

Detailed explanation-3: -In computer science, a float is a data type composed of a number that is not an integer, because it includes a fraction represented in decimal format.

Detailed explanation-4: -Floating-point numbers use the IEEE (Institute of Electrical and Electronics Engineers) format. Single-precision values with float type have 4 bytes, consisting of a sign bit, an 8-bit excess-127 binary exponent, and a 23-bit mantissa. The mantissa represents a number between 1.0 and 2.0.

There is 1 question to complete.