From c670ff17e97ec7798eebb3b04e2e2e191450ae03 Mon Sep 17 00:00:00 2001 From: Antti H S Laaksonen Date: Wed, 1 Mar 2017 22:03:44 +0200 Subject: [PATCH] Fix int ranges [closes #13] --- chapter10.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chapter10.tex b/chapter10.tex index e282429..d56c639 100644 --- a/chapter10.tex +++ b/chapter10.tex @@ -36,10 +36,10 @@ Usually a signed representation is used, which means that both negative and positive numbers can be represented. A signed number of $n$ bits can contain any -integer between $2^{n-1}$ and $2^{n-1}-1$. +integer between $-2^{n-1}$ and $2^{n-1}-1$. For example, the \texttt{int} type in C++ is a signed type, and it can contain any -integer between $2^{31}$ and $2^{31}-1$. +integer between $-2^{31}$ and $2^{31}-1$. The first bit in a signed representation is the sign of the number (0 for nonnegative numbers