#1
Which of the following is a floating-point data type in most programming languages?
float
ExplanationFloating-point data type commonly used for decimal numbers.
#2
In most programming languages, what is the default type for floating-point literals?
double
ExplanationDefault type for floating-point literals.
#3
What is the default size of a 'double' data type in many programming languages?
64 bits
ExplanationDefault size for 'double' data type.
#4
What does the term 'NaN' stand for in the context of floating-point arithmetic?
Not a Number
ExplanationRepresentation for undefined or invalid values.
#5
Which programming languages commonly use the 'float' data type for floating-point numbers?
All of the above
ExplanationMany languages support the 'float' data type.
#6
What does IEEE 754 standard define regarding floating-point representation?
Floating-point arithmetic
ExplanationStandard that defines floating-point arithmetic and representation.
#7
In a floating-point literal, what does 'e' or 'E' represent?
Exponent
ExplanationIndicates the exponent part of the number.
#8
Which of the following statements about floating-point arithmetic is true?
Floating-point arithmetic can suffer from rounding errors.
ExplanationErrors due to rounding during arithmetic operations.
#9
What is the main advantage of using floating-point data types over fixed-point data types?
Floating-point data types can represent a wider range of values.
ExplanationAbility to represent a broader spectrum of numbers.
#10
In floating-point representation, what does the 'mantissa' refer to?
Fractional part
ExplanationFractional component of a floating-point number.
#11
What is the significance of 'NaN' in floating-point arithmetic?
Not a Number
ExplanationValue used to represent undefined or invalid results.
#12
What is the term for the smallest positive floating-point value representable in a given data type?
Epsilon
ExplanationThe smallest increment representable.
#13
Which of the following is not a valid floating-point representation?
0.1f
ExplanationIncorrect format for a floating-point number.
#14
What is the term used to describe the loss of significance that can occur when subtracting two nearly equal floating-point numbers?
Cancellation
ExplanationLoss of precision due to subtracting similar values.
#15
Which of the following is a common method for comparing floating-point numbers due to precision issues?
Absolute difference comparison
ExplanationComparison based on the absolute difference.