The Artima Developer Community


Errata for Programming in Scala, Third Edition
Chapter 5: Basic Types and Operations
Return to errata index.

Page 74 (PDF page 113):
Table 5.1 - Some basic types
Basic type Range
Byte 8-bit signed two's complement integer (-27 to 27 - 1, inclusive)
Short 16-bit signed two's complement integer (-215 to 215 - 1, inclusive)
Int 32-bit signed two's complement integer (-231 to 231 - 1, inclusive)
Long 64-bit signed two's complement integer (-263 to 263 - 1, inclusive)
Char 16-bit unsigned Unicode character (0 to 216 - 1, inclusive)

-27 to 27 - 1 should be -2^7 to 2^7 -1, the other errors are the same.

NOTE: This is fine in the PDF, so perhaps this is a problem in the MOBI
or EPUB versions.
Page 92 (PDF page 130):
Table 5.3 Operator precedence
The order of "= !" and "< >" should be inverted with respect to the
language specification (cf.
https://www.scala-lang.org/files/archive/spec/2.12/06-expressions.html#inf
ix-operations).
Testing seems to confirm the language specification is correct.
---
Wow that's a good one. Fixed in 5ed. Tnx.

Page number: Book type: Paperback book PDF eBook
Book version: (Or build date. Found on back of title page.)
Your feedback:
Your name: (optional)
Your email address: (optional) (will not be published)

Copyright © 2021 Artima, Inc. All rights reserved.