These 3 lines should really be
```scala
val sign = if (a < 0.0) -1.0 else 1.0
```
Note that there should be a space between `if` and `(`. The same applies to the first `if` int the method.