ThatQuiz Test Library Take this test now
Decimal data type - Quiz
Contributed by: Leigh
  • 1. What is the primary purpose of a decimal data type?
A) To represent non-repeating decimal fractions without rounding
B) To increase the speed of binary calculations
C) To replace all floating-point numbers in memory
D) To store only integer values
  • 2. Why do floating-point numbers often struggle with representing 0.3 accurately?
A) They do not support non-repeating fractions
B) They use a base-10 exponent exclusively
C) They have too many bits for simple fractions
D) They restrict the denominator to a power of two
  • 3. In the context of decimal representation, what happens when 0.1 * 7 is evaluated in some systems?
A) It may evaluate to false due to inexactness
B) It always equals 0.7000000000000001
C) It results in an error
D) It is always true
  • 4. Which of the following is a common real-world application where decimal fractions are preferred?
A) Hardware interrupt handling
B) Currency
C) Binary networking protocols
D) Low-level machine instruction sets
  • 5. How can a decimal data type be implemented?
A) Only as a fixed-point number
B) As either a floating-point or fixed-point number
C) Only as a floating-point number
D) As an array of characters
  • 6. What characterizes the fixed-point implementation of a decimal type?
A) The exponent varies
B) The denominator is set to a fixed power of ten
C) It is always less precise than floating-point
D) The denominator is always a power of two
  • 7. What is the key feature of a floating-point decimal implementation?
A) No mantissa
B) A variable exponent represents the power of ten
C) A fixed denominator
D) A restricted exponent range of 0 to 10
  • 8. How are rational data types typically constructed?
A) From a hex code
B) From two integers
C) From a string
D) From a single floating-point number
  • 9. Which standard specifies three floating-point decimal data types?
A) Unicode Standard
B) ANSI C
C) IEEE 754
D) ISO/IEC 9899
  • 10. Which of the following is an IEEE 754 decimal floating-point format?
A) Decimal16
B) Decimal32
C) Decimal256
D) Decimal8
  • 11. How many bits are used by the C# built-in decimal data type?
A) 256 bits
B) 128 bits
C) 64 bits
D) 32 bits
  • 12. Which class is used for decimal calculations in Python?
A) python.Float
B) decimal.Decimal
C) math.Fixed
D) num.Decimal
  • 13. What is the decimal library class used in Ruby?
A) Float64
B) BigDecimal
C) DecimalNumber
D) RationalNum
  • 14. What is the name of the class for decimals in Java?
A) java.core.Fixed
B) java.math.DecimalNumber
C) java.decimal.Decimal
D) java.math.BigDecimal
  • 15. What is the maximum mantissa length for the NSDecimalNumber class?
A) 28 digits
B) 64 digits
C) 128 digits
D) 38 digits
  • 16. What does ABAP's DECFLOAT16 correspond to?
A) decimal128
B) decimal64
C) fixed-point decimal
D) decimal32
  • 17. Which language provides support for decimal floats as an extension via gcc?
A) C and C++
B) Python
C) Ruby
D) Java
  • 18. What is the approximate range of the C# decimal type?
A) ±1.0 × 10−128 to ±1.0 × 10127
B) ±232 to ±264
C) ±0.001 to ±1000
D) ±1.0 × 10−28 to ±7.9228 × 1028
  • 19. Which language natively supports both fixed-point and floating-point decimal data?
A) PL/I
B) Python
C) Ruby
D) C#
  • 20. What is the range of the exponent in the Cocoa NSDecimalNumber class?
A) -28 to 28
B) -128 to 127
C) -64 to 64
D) 0 to 38
Created with That Quiz — where test making and test taking are made easy for math and other subject areas.