Floating Point MCQs

12 MCQs  — Data Types MCQs  (Page 1 of 2)

Practice Floating Point MCQs with correct answers and explanations. These questions are from the Data Types MCQs section.

What does Python's 0.1 + 0.2 == 0.3 evaluate to?
True
TypeError
It depends on the operating system
False
How are the 64 bits of an IEEE 754 double-precision number divided?
1 sign bit, 15 exponent bits, 48 fraction bits
1 sign bit, 11 exponent bits, 52 fraction bits
1 sign bit, 8 exponent bits, 55 fraction bits
2 sign bits, 10 exponent bits, 52 fraction bits
Approximately how many significant decimal digits do float and double provide?
Both about 7
float about 7; double about 15–16
float about 3; double about 7
float about 15; double about 30
In Java, what does 1.0 / 0 evaluate to?
NaN
An ArithmeticException is thrown
0
Infinity