{infiniteZest} // Articles. Tutorials. Utilities.
Categories Test: Swift - Floating Point Types

3. let hexWithExp = 0x10p4 - What’s the value of hexWithExp in decimal?

 [CORRECT ANSWER] 256 512 160 Error

Results
Congratulations! Correct Answer.
You Answered: None. If you took the test, your answer will show up here.
Correct Answer: 256
Explanation
The value of the exponent part to multiply is 2^4, which is 16. The hex number 0x10 will be 16 in decimal (1*16^1 + 0*16^0 = 16). And 16*16 is 256.
Take the Test
Take the complete test on this topic. You will be able to review answers to questions and get a test score.

Take the Test

Question 3 of 5

Test is Based on this Article Tags: This article talks about decimal numbers in Swift, including Float, Double, and CGFloat. Also talks about Binary, Octal, and Hexadecimal representations. Tags: Test on Float and Double types in Swift, as well as binary, octal, and hex representations.

More Articles With Similar Tags Tags: Test on Float and Double types in Swift, as well as binary, octal, and hex representations. Tags: This series of articles goes through the basics of Swift. It introduces Playgrounds and REPL; Variables and Constants; Int, Float, Bool; Tuples, Type Aliases, Type Inference, Type Safety, and more. Tags: This article discusses the boolean types in Swift and contrasts with how these types are used in C and Objective-C. Tags: Test on Boolean Types in Swift. Tags: This article goes through the usage of various integer types in Swift (including Int and UInt).

About  Contact  Privacy Policy  Site Map