Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Swift Basics Swift Types Recap: Swift Types

Michael Ballew
seal-mask
.a{fill-rule:evenodd;}techdegree
Michael Ballew
iOS Development Techdegree Student 1,728 Points

Clarification on Data Types

In the quiz I am taking, a multiple choice question is presented that states "Which of the following is not a numerical data type?" Choices are Int, Float, Double, Bool, None of the above. Now I understand that the boolean values of True are False are represented by 1 and 0, but this does not make it a numerical data type... does it?

I chose, Bool and got the question wrong.

2 Answers

If all of them are numerical data types, you should select "None of the above" because none of the above values (Int, Float, Bool) are not numerical types. In other words, all of the above are numerical types and the challenge is asking which one is not numerical; and all of the above are numerical.

Does this make sense?

I hope this helps. ~Alex

Michael Ballew
seal-mask
.a{fill-rule:evenodd;}techdegree
Michael Ballew
iOS Development Techdegree Student 1,728 Points

Thanks Alex. But my question is more about whether or not a Bool is actually a numeric type. In other languages it is not considered numeric. From the MSDN for Visual Basic, Visual Studio 2015, "Boolean values are not stored as numbers, and the stored values are not intended to be equivalent to numbers." "Boolean is not a numeric type." and so on.

Is it that Swift as its own language defines booleans differently? Thanks for your feedback.

Did you get a answer to this now? I'm doing the challenge right now and im curious too.