A few new concepts are needed for this SKB.
First, what is a
Boolean can only take two values:
false. It is the result of a mathematical question. For instance, is 2 less than 5 (
2 < 5), it would returns "yes" (
And from previous SKB, you might have noticed that
assert tests if what is inside is
In Scala, and in the majority of other programming languages, you have a series of built-in comparators for mathematics:
==: for equality. Some tips here:
==. With only one
=, it would be an assignation (Like in:
val a = 2).
1.5632426546, they are called
Float) because the computer will round those numbers. So instead of
a == b, you should be doing something like:
Math.abs(a - b) < 0.01.
!=: Not equal
>: Greater than
<: Less than
>=: Greater than or equal
<=: Less than or equal